1wire devices

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
shell
Posts: 15
Joined: Tue Aug 12, 2014 8:31 pm
Location: Germany
Contact:

1wire devices

Post by shell » Fri Oct 17, 2014 9:10 am

Hello everyone!

Anyone tried to connect 1-Wire devices. For example the DS18B20 ? There is already a class for the ds18b20

Gordon_Hardman
Posts: 68
Joined: Sat May 03, 2014 11:31 pm

Re: 1wire devices

Post by Gordon_Hardman » Fri Jan 02, 2015 4:24 pm

Hi Shell-

I wonder if you made any progress with this? I am going to have to talk to one of the DS1820 family pretty soon.

Gordon

User avatar
shell
Posts: 15
Joined: Tue Aug 12, 2014 8:31 pm
Location: Germany
Contact:

Re: 1wire devices

Post by shell » Sun Jan 18, 2015 7:38 pm

No, i was very busy last time.

JasonHildebrand
Posts: 7
Joined: Thu Jan 29, 2015 4:03 am

Re: 1wire devices

Post by JasonHildebrand » Thu Jan 29, 2015 4:11 am

BTW, the one-wire module you linked to above appears to be for raspberry pi. It assumes that several kernel modules are available which will not be the case in micropython (since there is no kernel).

Over the holidays I spent a number of hours working on 1-wire support. I was not able to get it working using pure-python, I think because the timing was not tight enough. So I implemented a C module which can be imported from python. With this I was able to communicate with a DS18S20!

I am cleaning up the code and will post it soon on github. One issue is that right now is that I implemented it within the stmhal directory of the micropython source (since I am using an stmhal board), so would not be part of builds for the other micropython ports. I am looking into how to do this.

Feel free to poke me if you don't see any update within the next few days.

Gordon_Hardman
Posts: 68
Joined: Sat May 03, 2014 11:31 pm

Re: 1wire devices

Post by Gordon_Hardman » Wed Feb 11, 2015 11:11 pm

I wonder how this is going? I just received some of the DS18B20s to play with...

JasonHildebrand
Posts: 7
Joined: Thu Jan 29, 2015 4:03 am

Re: 1wire devices

Post by JasonHildebrand » Fri Feb 13, 2015 4:22 am

Gordon_Hardman wrote:I wonder how this is going? I just received some of the DS18B20s to play with...
It's going well, though I've switched back to a pure-python approach. You can follow more closely here:
https://github.com/micropython/micropython/pull/1095

I'm gone for the weekend but will hopefully post some working code within the next week or so. Sorry to keep you waiting (I know it's hard).
I have a DS18S20 I'm testing with, not sure if there are substantial differences between the "B" and "S" variants.

Jonas
Posts: 29
Joined: Fri Jan 23, 2015 8:32 pm

Re: 1wire devices

Post by Jonas » Sun Feb 15, 2015 12:42 pm

Has anyone tried to connect to 1-wire from uart?

http://www.maximintegrated.com/en/app-n ... mvp/id/214

JasonHildebrand
Posts: 7
Joined: Thu Jan 29, 2015 4:03 am

Re: 1wire devices

Post by JasonHildebrand » Sat Feb 28, 2015 3:23 am

Update - if you follow the link to github I posted earlier, there is now working onewire / ds18s20 driver.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: 1wire devices

Post by Damien » Tue Mar 03, 2015 1:35 am

There is now a 1-wire driver in the official repository, along with a driver for the DS18x20 temperature sensors (that works with DS18S20 and BS18B20). The drivers work with single and multiple devices on the bus.

Thanks to @JasonHilderbrand for the hard work doing the port!

Links to the Python code:

https://raw.githubusercontent.com/micro ... onewire.py
https://raw.githubusercontent.com/micro ... ds18x20.py

mattyb
Posts: 1
Joined: Wed Mar 04, 2015 12:18 am

Re: 1wire devices

Post by mattyb » Wed Mar 04, 2015 12:19 am

This is the first time I've needed to install a driver on the micropython. How does one do so?
While on the topic, how does one install a python library?

Post Reply