You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing an application that uses a DS18B20 temp sensor and sends the data to Sigfox every hour.
When trying to send a Sigfox message with the OneWire bus enabled, the board hangs and does not return to the REPL. A reset is required to make it work again.
If the last line is commented out. the code will print the current temp and return to the prompt. Likewise if the OneWire code is commented out, the Sigfox message will send. But if I try to use both at the same time it does not work.
I'm using the DS18B20 example as a base, I have not changed the OneWire.py or boot.py files at all.
Firmware Version - output of os.uname():
(sysname='SiPy', nodename='SiPy', release='1.18.2.r5', version='v1.8.6-849-396d71b on 2019-04-16', machine='SiPy with ESP32', sigfox='1.0.1')
My main.py:
fromnetworkimportSigfox# sigfox libsimporttimefrommachineimportPin# listings for device pinsfromonewireimportDS18X20# driver for the temperature sensorfromonewireimportOneWire# onewire driver for DS18B20 driver aboveimportsocket# sigfoximportstruct# compression of float values# init Sigfox for RCZ1 (Europe)sigfox=Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1)
# create a Sigfox sockets=socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
# make the socket blockings.setblocking(True)
# configure it as uplink onlys.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
#DS18B20 temp sensor data line (yellow wire) connected to pin P8 (G15 on Expansion Board)ow=OneWire(Pin('P8')) # enabling the onewire bus causes the device to freeze when sending sigfox messagetemp=DS18X20(ow)
temp.start_conversion()
time.sleep(1)
temp=round(temp.read_temp_async(), 2) # round the temp value to two decimal placesprint("Temp =")
print(float(temp))
print("sending data")
#s.send(struct.pack('f',float(34.1)) + bytes([12])) # will freeze the board unless OneWire code is commented out!
The text was updated successfully, but these errors were encountered:
I'm developing an application that uses a DS18B20 temp sensor and sends the data to Sigfox every hour.
When trying to send a Sigfox message with the OneWire bus enabled, the board hangs and does not return to the REPL. A reset is required to make it work again.
If the last line is commented out. the code will print the current temp and return to the prompt. Likewise if the OneWire code is commented out, the Sigfox message will send. But if I try to use both at the same time it does not work.
I'm using the DS18B20 example as a base, I have not changed the OneWire.py or boot.py files at all.
Firmware Version - output of os.uname():
My main.py:
The text was updated successfully, but these errors were encountered: