You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just tried tail -f /sys/class/msensor/sensor0/value0 and didn't see the value change as I tried toggling a touch sensor... is there a way to select/poll on /sys fs mounts, or more broadly how do I get asynchronous notifications of sensor changes?
sysfs does have a mechanism for select/poll, but we have not implemented it with sensors yet, but we do intend to. It is not something that just happens automatically.
I've worked on embedded systems before and could help out, is there a guide for getting up and running with the latest ev3dev kernel development environment? I think I see how to set up a debian/jessie VM and get brickstrap up and running, but having all the needed config files in one place would be really helpful.
For kernel hacking we cross compile instead of using brickstrap. See https://github.com/ev3dev/ev3dev-buildscripts. This might be a bit out of date, so don't hesitate to ask questions here or on IRC.
Once you have installed the debian package that you created, you can then replace the uImage and modules directly without having to build another debian package (as long as you don't change the version number). See https://github.com/ev3dev/ev3dev-buildscripts/blob/master/setup-env for how to get the build scripts to install the generated files wherever you want. If you setup NFS, then you can tell it to install directly on your EV3 while it is up and running.
Most drivers are modules, so I modprobe -r <module>, compile (which automatically copies over the existing .ko file, and them modprobe <module>. This way I don't have to reboot every time I make a change.
We aren't planning on doing much more with wheezy and are focusing on jessie now, so you will want the kernel from ev3dev/ev3dev-kernel, not the one at mindboards/ev3dev-kernel.
I am also thinking that we may want a switch to turn this on and off. My concern is that this may take up quite a bit of CPU - at least for sensors that change values rapidly. If this is the case, we would want sysfs_notify disabled by default. Then users could enable it only if they really wanted it.
Yeah, I think we'd want to be able to turn sensor notifications off and on by setting limits. This would be similar to how I implemented ramping in the motor drivers - ramp value 0 means no ramping...
I think my rechargeable batteries were picking that exact moment to call it quits (the brick would boot and then power off after a few minutes)... recharging them now.
When I get all this working correctly I'll make an ev3dev docker image which should simplify setting up the build environment a lot.
I've finally gotten some time to work on this again (recharged the batteries), USB networking is working but wifi doesn't. I've got the realtek 0bda:8179 USB dongle which was working fine with the prebuilt kernel, the kernel I've built:
Yes, known issue and will be adressed in the next kernel release. Fo now, just use the module, run depmod and the next time you plug in the dongle it should magically work!
Sorry, that is old info. We are now building the rtl8188eu module as a debian package that gets distributed with the kernel. https://github.com/ev3dev/rtl8188eu. Since you are building your own kernel, you will have to compile it separately - not as a debian package, but using the same source code. It should be pretty straight forward. You can ping me on IRC if you need help figuring it out.
This is something that has come up again more recently. My current line of thought is that the best way to do this is using a character device similar to the Linux input/event subsystem.
I'm closing this issue in favor of #498 since this issue is quite old and no longer has much relevant information. Any further comments should be made on #498.
Activity
dlech commentedon Jul 18, 2014
sysfs does have a mechanism for select/poll, but we have not implemented it with sensors yet, but we do intend to. It is not something that just happens automatically.
eahutchins commentedon Jul 18, 2014
I've worked on embedded systems before and could help out, is there a guide for getting up and running with the latest ev3dev kernel development environment? I think I see how to set up a debian/jessie VM and get brickstrap up and running, but having all the needed config files in one place would be really helpful.
dlech commentedon Jul 18, 2014
For kernel hacking we cross compile instead of using brickstrap. See https://github.com/ev3dev/ev3dev-buildscripts. This might be a bit out of date, so don't hesitate to ask questions here or on IRC.
My basic work flow is like this.
modprobe -r <module>, compile (which automatically copies over the existing .ko file, and themmodprobe <module>. This way I don't have to reboot every time I make a change.We aren't planning on doing much more with wheezy and are focusing on jessie now, so you will want the kernel from ev3dev/ev3dev-kernel, not the one at mindboards/ev3dev-kernel.
And finally, the file you need to modify is https://github.com/ev3dev/ev3dev-kernel/blob/ev3dev-jessie/drivers/legoev3/msensor_class.c.
sysfs_notifyis the function that you need to add. Here is how Ralph implemented sysfs_notify for motors: ev3dev/ev3-kernel@f7557cd and here is how I fixed it because you can't call sysfs_notify from an atomic context: ev3dev/ev3-kernel@0ca28cf.I am also thinking that we may want a switch to turn this on and off. My concern is that this may take up quite a bit of CPU - at least for sensors that change values rapidly. If this is the case, we would want sysfs_notify disabled by default. Then users could enable it only if they really wanted it.
This should keep your busy for a while. 😄
rhempel commentedon Jul 19, 2014
Yeah, I think we'd want to be able to turn sensor notifications off and on by setting limits. This would be similar to how I implemented ramping in the motor drivers - ramp value 0 means no ramping...
eahutchins commentedon Jul 24, 2014
I've managed to build the kernel under docker (I'm a linux laptop guy) using the ubuntu:latest (14.04) image.
I had to replace the
uboot-mkimagepackage withu-boot-tools, and installbc(sudo apt-get install bc). I got some warnings:but I ignored them :-)
seems to have worked but undone all my network/zeroconf setup.
dlech commentedon Jul 24, 2014
Thanks for the feedback. I have updated the script and README accordingly.
Not sure why it would wipe out your network/zeroconf setup though.
eahutchins commentedon Jul 24, 2014
I think my rechargeable batteries were picking that exact moment to call it quits (the brick would boot and then power off after a few minutes)... recharging them now.
When I get all this working correctly I'll make an ev3dev docker image which should simplify setting up the build environment a lot.
eahutchins commentedon Aug 7, 2014
I've finally gotten some time to work on this again (recharged the batteries), USB networking is working but wifi doesn't. I've got the realtek 0bda:8179 USB dongle which was working fine with the prebuilt kernel, the kernel I've built:
seems to be missing the module. Should I use https://github.com/ev3dev/ev3dev/releases/tag/v00.01.01-rtl8188eu-module?
rhempel commentedon Aug 7, 2014
Yes, known issue and will be adressed in the next kernel release. Fo now, just use the module, run depmod and the next time you plug in the dongle it should magically work!
eahutchins commentedon Aug 7, 2014
https://github.com/ev3dev/ev3dev/releases/tag/v00.01.01-rtl8188eu-module doesn't seem to contain the driver (just
LICENSEREADME.md)...I'm following along from here:
https://github.com/ev3dev/ev3dev/wiki/Add-An-Unsupported-wifi-Dongle#wait-for-someone-to-build-the-kernel-module
dlech commentedon Aug 7, 2014
Sorry, that is old info. We are now building the rtl8188eu module as a debian package that gets distributed with the kernel. https://github.com/ev3dev/rtl8188eu. Since you are building your own kernel, you will have to compile it separately - not as a debian package, but using the same source code. It should be pretty straight forward. You can ping me on IRC if you need help figuring it out.
dlech commentedon Dec 12, 2015
This is something that has come up again more recently. My current line of thought is that the best way to do this is using a character device similar to the Linux input/event subsystem.
dlech commentedon Jan 10, 2016
I'm closing this issue in favor of #498 since this issue is quite old and no longer has much relevant information. Any further comments should be made on #498.
WasabiFan commentedon Jan 10, 2016
Uhhhh... the issue is still open half an hour later 😉 Any chance that you forgot about the "closing" bit?
dlech commentedon Jan 10, 2016
must have hit the wrong button.