VooDooSi / CH32V003_owSlave

0 stars 2 forks source link

Multidrop support #1

Open greg1985 opened 2 weeks ago

greg1985 commented 2 weeks ago

Hello, first of all I'd like to thank you for providing a port of owSlave. I successfully tested this lib and the slave device is recognized by the master.

The problem is when more than one 1wire device (real or emulated) is connected to the bus. In that case only one device (I think its always the emulated one) is seen by master. Is there any chance you could check the code to see how it can be optimized to allow more than one device be recognized by the master? If only real devices are connected to the bus the master sees them all (after I connect emualted device only this emulated one can be seen).

Your help will be highly appreciated as I am not that into 1wire innerworkings, yet.

Thank you in advance!

VooDooSi commented 2 weeks ago

Hi, I dont remember if i ever tested with more than one slave. Will check if i see something obvious.

greg1985 commented 1 week ago

Okay, I'm waiting for some clues.

VooDooSi commented 1 week ago

So i have tried it myself but no matter how many slaves i add all get recognised. Once emulated slave responds it doesn't answer again until next RESET occures. Is code working without emulated slave connected?

greg1985 commented 1 week ago

Thanks for checking on your side. Yes, without emulated devices the code was working just fine recognizing all real 1wire devices. I'll double check what's wrong with my code/hw then.

greg1985 commented 1 week ago

For 1wire master you are also using ch32v003 or something else? Could you publish the code you are using to list all emulated slave devices connected to the bus?

VooDooSi commented 1 week ago

For 1 wire master i used arduino while testing. I do use 32v203 as 1 wire master in one project but without multridrop functions. I think i did also port 1 wire master or at least part that does the scanning for devices. I will check when im home.

greg1985 commented 1 week ago

I've tested with OneWire master on ESP8266 (compiled with Arduino):

When you wrote you were testing whether many slave devices are recognized... you were mentioning many emulated slaves on the bus or one emulated slave + many real slaves on the bus?

VooDooSi commented 1 week ago

I am testing with arduino nano. Now i have tested 2 emulated slaves, 2 x ds18b20 and it works without a problem. image Ignore CRC error, had to change address of slave but didnt change CRC.

Have you changed address of the second emulated slave? If not it would appear as only one is connected.

greg1985 commented 1 week ago

Hi. Thanks for checking once again. Of course I'm using different addresses for all emulated slaves :) It's strange that it doesn't work for me but it works for you without any problems. Unfortunately I do not have arduino nano to fully replicate the environment you are using. I need to further investigate this (with logic analyzer), once I find more free time.

BTW. For ch32v003 - are you using interal or external oscillator? Boards I have are not equipped with external quartz thus I am using HSI. Please let me know what onewire lib you are using for master and share with me the code, if that's not a problem.