onewire example
-
when we use onewire example for DS18X20
but without any connected sensor we go two issues:
1.Traceback (most recent call last): File "<stdin>", line 1, in <module> File "dstemp.py", line 11, in <module> File "onewire.py", line 190, in read_temp_async IndexError: list index out of rangethis is because of this line
rom = rom or self.roms[0]
2. after exception when we rerun sample we got memory allocation errorwith sensor connected all is ok :)
-
@livius, as usual, thanks for your help :) , I think no one had used the script like that before ;) . We'll have a look at it.
-
@abilio
another error is for negative temperature for adress 28
code should be like thiselif rom0 == 0x28: temp = (temp_msb << 8 | temp_lsb) * 100 // 16 if (temp_msb & 0xf8) == 0xf8: # for negative temperature temp -= 0x1000 return tempi have created pull request as i see that now this is on github as libs
-
Hello,
On LopY, with build 1.1.1b1, onewire code is not reading anymore the DS1B20 sensor.
We simply upgrade Lopy that has connected the DS1B20 sensor(with pll pul rezist) on P23, GND, 3.3V ...Unplug LopY and plug WiPy with the same code and same build... everything is working fine.
Do you have any idea how to fix this regression on LOpY?
Thx
-
@Colateral said in onewire example:
1.1.1b1
Do you mean 1.5.1?
I do not have Lopy only Wipy - bot maybe someoune else can point you.One question - did you tried with different pin then P23?
Maybe something interfering. -
@livius Yes. Deeply sorry for the typo... ideed the build is 1.5.1b1. I tried also with other pin and I got the same. It is higher probability that is a timing (microseconds) microseconds issue related to LoPy.
On WipY is working fine: same expansion board same pin and DS1B20.
-
@livius I Know why I typed wrong the release name ... The downloaded pycom firmware update file is pycom_firmware_update_1.1.1.b1.exe .... that install 1.5.1.b1 firmware
-
@Colateral
Strange that you have this difference
because wipy is near equal to lopy
but have you connected antenas? especially to lora?
Without antena for lora it is possible to got interference and also damage board(low possible but..) -
@livius Both antennas were connected.
Today I unpacked a brand new LopY ... and we did again the tests. Same results also with this new one.
I send to Daniel the onewire.py script... you ca do it yourself and see the issue with your own eyes .
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login