@brossingo I'm using this lib for Pycom devices: https://github.com/pycom/pycom-libraries/tree/master/examples/DS18X20
It works well. I tested it only with a single device on the bus, but there is also support for multiple devices.
@brossingo G5 is an input only pin, like G4, G0, G3, G31 and G30. Try another pin, like G22 or G17 or G7 or G6 or ....
@robert-hh Hello. Thnak for your reply. Apparently, after the transfer, a H (or a I, etc) is added as the first caracter, as the following:
It the reason why I got that error. The problem, I can not correct it directely because after saving it, the file become newer than the source and it will be overwritten at the next sync.
Then I look at the other lib file and I observed than none of them has that line. I remove and it work until I got a message stating, it can not imported DS18X20.
I first open my file with textwrangler, then I open it with Atom and I observed, the text was terribly formated (A lot on the same line).
I reformat it and it's works but not always..
Now the problem it state a
here is line two:
What is wrong?
Then I gave a spave (return key) before the """ and I got the same error message
Then how can sync my onewire file without a formatting issue and with a unwish caracter before the first line?
Does I need to check something on Atom?
Thabk for your help
OK. Problem seems to be solved. I copy again the content of onewire.py to /Flash/lib/onwire.py and on Atom, at the bottom right, I changed LF to CRLF.
The problem does not appear any more.
That funny because my main.py has LF (and not CRLF) and I do not have this problem with main.py
@robert-hh Oh! thank, I missed it. Great I am happy to try it, this evening! Thank a lot!
@colombianaus said in DS18B20 not working in WiPy 2.0:
now you miss Pin class...
It looks like it needs a double scan to find the rom.
Even if the print is an empty array ('found devices:') then the temperature reading is working with appropriate rom...
Anyone can get why?
Is this what you downloaded from board or what you have on the computer?
Previously (for me still - however less than before) there are some corruption of files stored on the board.
try something like this
do you see some corruption in content?
Try also downloading file throught ftp - is this file same as your on the computer?
The freeze with gc.collect seems to be a bug in the firmware. @daniel is already working on it : https://forum.pycom.io/post/4219