MySensors Raspberry port suggestions
-
@marceloaqno said:
I ended up with two approaches:
Place the raspberry gateway files in a directory called examples_RPi within the libraries\MySensors folder (more or less like TMRh20/RF24 does)
https://github.com/marceloaqno/Arduino/tree/raspberry-gatewayor keep the two repos and use git subtree to bind them:
https://github.com/marceloaqno/Raspberry/tree/experimentalWhat you guys thinks?
I was also thinking back and forth whats the best way to accomplish this.
In the end i think the better way is to do it like TMRh20/RF24 do it, because it also fits better in the current mysensors git structure.@hek said:
Keeping the RPI specific files within libraries/MySensors/core and libraries/MySensors/drivers would be my first choice...
The RPi specific files would be withing these dirs, in examples_RPi would only be the example code for the serial-gateway, or other examples for the library. So this would be much like the arduino "examples" dir.
-
@marceloaqno I have been looking into your work to get the RaspberryPi up to date with the latest MySensors code. You have examples for Regular Gateway, Serial and Ethernet. Are you considering creating another for MQTT? I might start looking into this, just wanted to see if you had anything planned. I think it would be best to have a Raspberry PI acting as a gateway as well as an OpenHab/MQTT server.
-
@marceloaqno I have been looking into your work to get the RaspberryPi up to date with the latest MySensors code. You have examples for Regular Gateway, Serial and Ethernet. Are you considering creating another for MQTT? I might start looking into this, just wanted to see if you had anything planned. I think it would be best to have a Raspberry PI acting as a gateway as well as an OpenHab/MQTT server.
@aaron832 I'm planning to add support to MQTT directly into the ethernet gateway. Gonna try to use mongoose (https://github.com/cesanta/mongoose) for the MQTT so it wouldn't require any external library. I got stuck exploring the many cool things that can be done with Node-Red that I didn't start to implement anything yet :stuck_out_tongue_winking_eye:
-
@aaron832 I'm planning to add support to MQTT directly into the ethernet gateway. Gonna try to use mongoose (https://github.com/cesanta/mongoose) for the MQTT so it wouldn't require any external library. I got stuck exploring the many cool things that can be done with Node-Red that I didn't start to implement anything yet :stuck_out_tongue_winking_eye:
@marceloaqno Ha, Cool. Happy to hear you are looking at MQTT. I will keep a watch on your repository and will try experimenting with using mongoose as well.
-
Just as an update, I have the MQTT version with mongoose mostly working. Thanks for that recommendation @marceloaqno. Still very much a work in progress. If anyone is interested in following, here is the link: https://github.com/aaron832/Arduino/tree/raspberry-gateway-MQTT/libraries/MySensors/examples_RPi
-
FYI I had to ditch mongoose. It just wan't working properly. libmosquitto from http://mosquitto.org/ seems to work a lot better. Any idea about getting @marceloaqno 's branch merged into develop or vise versa? Would be nice to be working on 2.0
-
FYI I had to ditch mongoose. It just wan't working properly. libmosquitto from http://mosquitto.org/ seems to work a lot better. Any idea about getting @marceloaqno 's branch merged into develop or vise versa? Would be nice to be working on 2.0
@aaron832 I'm very close to reaching a working version for the 2.0, will release something in the coming days.
-
@aaron832 I'm very close to reaching a working version for the 2.0, will release something in the coming days.
@marceloaqno This is good news because I was about to give up trying to do the port. :sweat_smile: Hopefully some of my stuff was of some use.
-
This is the initial support for Linux/RaspberryPi for the 2.0:
https://github.com/marceloaqno/Arduino/tree/dev-raspberrypiSupports:
- RF24 radio
- Ethernet gateway
- Store "eeprom" to a file (thanks to @aaron832 )
- MQTT (thanks to @aaron832 )
- Can be compiled in a linux machine other than Pi
To be implemented:
Store "eeprom" to a fileSerialMQTTRF24 interrupts- UDP
- Act as a client to connect to a controller
I haven't extensively test it, so there are probably some bugs. Any suggestions or ideas for improvement are welcome.
-
Thanks a bunch @marceloaqno for you update to 2.0. Some initial testing shows its working fine. I went ahead and just re-implemented my MQTT addition on top of this branch. Its significantly cleaner and just sits alongside your ethernet implementation. This way you can still connect with a controller via ethernet while getting the benefit of MQTT as well if desired.
For the initial changes I created a pull request:
https://github.com/marceloaqno/Arduino/pull/2
for my branch
https://github.com/aaron832/Arduino/tree/feature/MQTTSupport -
Perhaps we should start another topic with a better name so that more people become aware of this port?
-
Perhaps we should start another topic with a better name so that more people become aware of this port?
-
@lafleur Do you recommend any RFM69h library that works well in Pi? I could try to add support if there is any.
-
There are a number of ports to the RPI...
http://rdepablos.merlitec.com/mixed/rfm69-library-for-raspberry-pi
http://jeelabs.org/wp-content/uploads/2015/05/20/rfm69-on-raspberry-pi/index.html
https://github.com/etrombly/RFM69
https://123d.circuits.io/circuits/519561-raspberry-pi-and-rfm69hw-interface
http://www.0x1.be/esa/domotic/arduino/node/domotic-howto-rfm69/
and others...
Thanks
-
Just an update, I've been using this port on my raspberry pi during the last months and it has been quite stable, the code is also up to date with the mysensors development branch.
-
That's great, thanks @marceloaqno
I just started testing but I had to revert to 7d51087e589afb1296e71442fe2164807da399ef to have it working.
Last commit SEGFAULT afterEth: Listening for connections on 0.0.0.0:5003Also, do you have an updated initscript to launch it automatically at boot? It seems the one from the old PiGateway is not working very well with this one. For now I just added a cronjob.
-
@emc2 Could you give more information about your setup? I wasn't able to reproduce the error.
For the initscript, I will try to add an updated version for systemd.
-
So I did a few tests, one of my setup is working on the last commit, the other not. Both are model B.
-
Working Pi:
Domoticz image, upgraded and up to date wheezy -
Commit 7d51087e589afb1296e71442fe2164807da399ef Pi:
Regular (non-Domoticz) old wheezy image updated to jessie
All are up to date for all package on apt and firmware is up to date for rpi-update
Linux domoticz 4.4.15+ #897 Tue Jul 12 18:38:58 BST 2016 armv6l GNU/LinuxMy bet is that my "non-working" Pi, wich is also my guinea pig Pi, is missing a dependency or something. Let me know if I can get you some logs to troubleshoot, but it may be very specific to this setup so may not be worthwhile investigation unless a common factor start to emerge.
Anyways, thanks for the port! :+1:
-