Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to build a generic slave for arbitrary code? #90

Open
level20peon opened this issue Jul 5, 2020 · 0 comments
Open

how to build a generic slave for arbitrary code? #90

level20peon opened this issue Jul 5, 2020 · 0 comments

Comments

@level20peon
Copy link

level20peon commented Jul 5, 2020

I am trying to build a slave which doesn't emulate an actual device but rather just uses the OneWireHub message framework in order to execute arbitrary code.

More specifically, I am talking to an AtTiny85 and want it to answer according to the data I sent to it (so something like "switch (cmd) { case 0x4E:..." hub->send('foo')). Unfortunately I don't know how to accomplish this, so what would you suggest I use as a codebase in order to emulate such a kind of slave?

I got the general attiny85-4slaves.ino up and running, but there's no input open which I could send data to (I can only poll the temperature of the DS18B20 via "cat /sys/bus/w1/devices/28-0b020b08010d/w1_slave" using a Pi). Could you point me to some example please? From what I read I need the "output" and the "state" file descriptors on the onewire device. I added the DS2408 device to the attiny demo, but I am unable to write anything to the state descriptor and while skipping the source code I don't understand how those descriptors are generated in the first place (there is no reference to "output" or "state" in the DS2408 header and cpp source files.

Maybe somebody already accomplished what I am trying to do? Any help would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant