MySensors Raspberry port suggestions
-
Continuing the learning here, new questions... Thanks so far, I've now got the temp/hum/door messages sent and received from sensebender micro to raspi2. The next thing I would like to do is to send the messages as mqtt to the next box hosting some controller.
How to get the mysGateway to send the stuff forward as mqtt? I tried to look into Makefile, MyConfig.h and such, but didn't quite figure out yet how to do that. Any pointers?
So I'd like to have the following: sensebender -> radio -> raspi2 -> some box hosting the controller. Perhaps even outside of home, so routable traffic e.g. to OpenShift.com.
Should I now somehow configure and build mysGateway to send stuff as MQTT, or pipe the traffic somehow to mqtt like mosqitto? How is this normally done if the controller server is not running on the gateway Raspi?
Thanks for the patience, I'm just getting into all this interesting stuff :)
-
Continuing the learning here, new questions... Thanks so far, I've now got the temp/hum/door messages sent and received from sensebender micro to raspi2. The next thing I would like to do is to send the messages as mqtt to the next box hosting some controller.
How to get the mysGateway to send the stuff forward as mqtt? I tried to look into Makefile, MyConfig.h and such, but didn't quite figure out yet how to do that. Any pointers?
So I'd like to have the following: sensebender -> radio -> raspi2 -> some box hosting the controller. Perhaps even outside of home, so routable traffic e.g. to OpenShift.com.
Should I now somehow configure and build mysGateway to send stuff as MQTT, or pipe the traffic somehow to mqtt like mosqitto? How is this normally done if the controller server is not running on the gateway Raspi?
Thanks for the patience, I'm just getting into all this interesting stuff :)
-
Continuing the learning here, new questions... Thanks so far, I've now got the temp/hum/door messages sent and received from sensebender micro to raspi2. The next thing I would like to do is to send the messages as mqtt to the next box hosting some controller.
How to get the mysGateway to send the stuff forward as mqtt? I tried to look into Makefile, MyConfig.h and such, but didn't quite figure out yet how to do that. Any pointers?
So I'd like to have the following: sensebender -> radio -> raspi2 -> some box hosting the controller. Perhaps even outside of home, so routable traffic e.g. to OpenShift.com.
Should I now somehow configure and build mysGateway to send stuff as MQTT, or pipe the traffic somehow to mqtt like mosqitto? How is this normally done if the controller server is not running on the gateway Raspi?
Thanks for the patience, I'm just getting into all this interesting stuff :)
@ikkeT you can build the Raspberry Pi mysGateway as either Serial, Ethernet or MQTT by using appropriate commandline parameters with the configure script. Just do ./configure --help and you'll get a list of all the options available. Once you've chosen your options and run configure then you 'make'. An example of a set of options that will generate an MQTT Gateway is:
./configure --my-debug=enable --my-gateway=mqtt --my-rf24-channel=100 --my-rf24-pa-level=RF24_PA_LOW --my-controller-ip-address=127,0,0,1 --my-port=1883
--my-mqtt-client-id=MyGW2 --my-mqtt-publish-topic-prefix="MyGW2out" --my-mqtt-subscribe-topic-prefix="MyGW2in"In this case my MQTT Broker is Mosquitto and is on the same Raspberry Pi hence the use of 127,0,0,1 for the specified --my-controller-ip-address. Change that as appropriate to your intended setup.
Hope that helps.
-
@ericvdb That's right. I hope to add support for RFM69, Serial and software signing very soon.
To use, clone the raspberryPi port for MySensors 2.0:
git clone https://github.com/marceloaqno/MySensors.git cd MySensorsTo configure it, take a look at the options available within configure:
./configure --helpFor other options, you may have to edit the sample file example_linux/mysGateway.cpp, and uncoment what you need.
Once done, run:
make sudo make installTo run the gateway you need to be root or use sudo:
sudo msyGateway -hFor wiring, follow this guide:
https://forum.mysensors.org/topic/2437/step-by-step-procedure-to-connect-the-nrf24l01-to-the-gpio-pins-and-use-the-raspberry-as-a-serial-gateway-mysensors-1-x@marceloaqno I have been trying to build this out by first building the RF24 library using the following:
git clone https://github.com/TMRh20/RF24.git cd RF24 make sudo make installHowever, this fails on the
makecommand:Makefile:17: Makefile.inc: No such file or directory [Running configure] [SECTION] Detecting arm compilation environment. [OK] arm-linux-gnueabihf-gcc detected. [OK] arm-linux-gnueabihf-g++ detected. [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2836, Type=RPi2, CPU=armv7l. [SECTION] Detecting DRIVER [OK] DRIVER detected:RPi. [SECTION] Detecting OS. [INFO] OS detected:LINUX. [SECTION] Preparing configuration. [SECTION] Saving configuration. [OK] Finished. arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c RF24.cpp cc1plus: error: bad value (cortex-a7) for -mtune switch Makefile:40: recipe for target 'RF24.o' failed make: *** [RF24.o] Error 1I am not sure what to do here. Looks like the gcc does not support the cortex-a7? I am trying to run this on my RPi 2 B.
-
@marceloaqno I have been trying to build this out by first building the RF24 library using the following:
git clone https://github.com/TMRh20/RF24.git cd RF24 make sudo make installHowever, this fails on the
makecommand:Makefile:17: Makefile.inc: No such file or directory [Running configure] [SECTION] Detecting arm compilation environment. [OK] arm-linux-gnueabihf-gcc detected. [OK] arm-linux-gnueabihf-g++ detected. [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2836, Type=RPi2, CPU=armv7l. [SECTION] Detecting DRIVER [OK] DRIVER detected:RPi. [SECTION] Detecting OS. [INFO] OS detected:LINUX. [SECTION] Preparing configuration. [SECTION] Saving configuration. [OK] Finished. arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -c RF24.cpp cc1plus: error: bad value (cortex-a7) for -mtune switch Makefile:40: recipe for target 'RF24.o' failed make: *** [RF24.o] Error 1I am not sure what to do here. Looks like the gcc does not support the cortex-a7? I am trying to run this on my RPi 2 B.
@wergeld I'm not sure why you are having this error, perhaps your version of gcc it's old? Did you try to update it?
You can skip the installation of TMRh20/RF24, it is no longer necessary to build RPi port. -
@wergeld I'm not sure why you are having this error, perhaps your version of gcc it's old? Did you try to update it?
You can skip the installation of TMRh20/RF24, it is no longer necessary to build RPi port.@marceloaqno said:
@wergeld I'm not sure why you are having this error, perhaps your version of gcc it's old? Did you try to update it?
You can skip the installation of TMRh20/RF24, it is no longer necessary to build RPi port.I have tried to update gcc but apt-get says it is already at latest version. I am upgrading to Jessie now as it has gcc 4.9 (I was running Wheezy with gcc 4.6).
Is there an updated build instruction set? I am planning on using this as a serial gateway with Domoticz on same RPi. -
@ikkeT you can build the Raspberry Pi mysGateway as either Serial, Ethernet or MQTT by using appropriate commandline parameters with the configure script. Just do ./configure --help and you'll get a list of all the options available. Once you've chosen your options and run configure then you 'make'. An example of a set of options that will generate an MQTT Gateway is:
./configure --my-debug=enable --my-gateway=mqtt --my-rf24-channel=100 --my-rf24-pa-level=RF24_PA_LOW --my-controller-ip-address=127,0,0,1 --my-port=1883
--my-mqtt-client-id=MyGW2 --my-mqtt-publish-topic-prefix="MyGW2out" --my-mqtt-subscribe-topic-prefix="MyGW2in"In this case my MQTT Broker is Mosquitto and is on the same Raspberry Pi hence the use of 127,0,0,1 for the specified --my-controller-ip-address. Change that as appropriate to your intended setup.
Hope that helps.
@hawk_2050 thanks for the reminder! I recalled it was somehow configurable, but I forgot it was through . /configure options. I'll try after getting pir working also.
-
@marceloaqno said:
@wergeld I'm not sure why you are having this error, perhaps your version of gcc it's old? Did you try to update it?
You can skip the installation of TMRh20/RF24, it is no longer necessary to build RPi port.I have tried to update gcc but apt-get says it is already at latest version. I am upgrading to Jessie now as it has gcc 4.9 (I was running Wheezy with gcc 4.6).
Is there an updated build instruction set? I am planning on using this as a serial gateway with Domoticz on same RPi.@wergeld I updated the building instructions:
https://forum.mysensors.org/topic/2759/mysensors-raspberry-port-suggestions/26 -
@wergeld I updated the building instructions:
https://forum.mysensors.org/topic/2759/mysensors-raspberry-port-suggestions/26@marceloaqno said:
@wergeld I updated the building instructions:
https://forum.mysensors.org/topic/2759/mysensors-raspberry-port-suggestions/26Success! Upgraded to Jessie and build worked fine. Now to reconnect my radio to the RPi pins directly to test.
-
@marceloaqno said:
@wergeld I updated the building instructions:
https://forum.mysensors.org/topic/2759/mysensors-raspberry-port-suggestions/26Success! Upgraded to Jessie and build worked fine. Now to reconnect my radio to the RPi pins directly to test.
@wergeld said:
@marceloaqno said:
@wergeld I updated the building instructions:
https://forum.mysensors.org/topic/2759/mysensors-raspberry-port-suggestions/26Success! Upgraded to Jessie and build worked fine. Now to reconnect my radio to the RPi pins directly to test.
Okay, using an RPi2B upgraded to Jessie from Wheezy I have successfully built and set the mysGateway as a daemon. My configuration was:
./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSBMySensorsGateway --my-rf24-pa-level=RF24_PA_LOWThis was immediately available in Domoticz under Hardware. I re-added the 2 nodes and away I went!
Full command list:
git clone https://github.com/marceloaqno/MySensors.git cd MySensors ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSBMySensorsGateway --my-rf24-pa-level=RF24_PA_LOW make sudo make install sudo mysGateway -bIn Domoticz it lists this gateway as running:
MySensors Gateway USB
Version: 2.0.1-betaSo far very happy with this setup. No wires and no extra arduino needed for serial gateway. Just the NRF+RPi interfacing via:
https://www.openhardware.io/view/100/Raspberry-PI-NRF24l01-hat -
what am I doing wrong here?
root@raspberrypi:/downloads/MySensors# ./configure --my-gateway=mqtt --my-mqtt-client-id=msgw --my-mqtt-publish-topic-prefix=mspub --my-mqtt-subscribe-topic-prefix=mssub --my-controller-ip-address=10.0.10.4 --my-port=1883 [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2835, Type=RPi, CPU=armv6l, REV=000d. [OK] init system detected: systemd [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished. root@raspberrypi:/downloads/MySensors# make cc -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/log.o drivers/Linux/log.c g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/noniso.o drivers/Linux/noniso.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Print.o drivers/Linux/Print.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetClient.o drivers/Linux/EthernetClient.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SerialPort.o drivers/Linux/SerialPort.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Stream.o drivers/Linux/Stream.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/IPAddress.o drivers/Linux/IPAddress.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/compatibility.o drivers/Linux/compatibility.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetServer.o drivers/Linux/EthernetServer.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o examples_linux/mysGateway.o examples_linux/mysGateway.cpp In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp: In function âvoid transportProcessMessage()â: ./core/MyTransport.cpp:535:61: error: no matching function for call to âmin(uint8_t, unsigned int)â const uint8_t msgLength = min(mGetLength(_msg), MAX_PAYLOAD); ^ ./core/MyTransport.cpp:535:61: note: candidates are: In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:535:61: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned charâ and âunsigned intâ) const uint8_t msgLength = min(mGetLength(_msg), MAX_PAYLOAD); ^ In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:535:61: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned charâ and âunsigned intâ) const uint8_t msgLength = min(mGetLength(_msg), MAX_PAYLOAD); ^ ./core/MyTransport.cpp: In function âbool transportSendWrite(uint8_t, MyMessage&)â: ./core/MyTransport.cpp:826:82: error: no matching function for call to âmin(unsigned int, const uint8_t&)â bool result = transportSend(to, &message, min(MAX_MESSAGE_LENGTH, totalMsgLength)); ^ ./core/MyTransport.cpp:826:82: note: candidates are: In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:826:82: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned intâ and âuint8_t {aka unsigned char}â) bool result = transportSend(to, &message, min(MAX_MESSAGE_LENGTH, totalMsgLength)); ^ In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:826:82: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned intâ and âuint8_t {aka unsigned char}â) bool result = transportSend(to, &message, min(MAX_MESSAGE_LENGTH, totalMsgLength)); ^ Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed make: *** [examples_linux/mysGateway.o] Error 1 root@raspberrypi:/downloads/MySensors# -
what am I doing wrong here?
root@raspberrypi:/downloads/MySensors# ./configure --my-gateway=mqtt --my-mqtt-client-id=msgw --my-mqtt-publish-topic-prefix=mspub --my-mqtt-subscribe-topic-prefix=mssub --my-controller-ip-address=10.0.10.4 --my-port=1883 [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2835, Type=RPi, CPU=armv6l, REV=000d. [OK] init system detected: systemd [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished. root@raspberrypi:/downloads/MySensors# make cc -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/log.o drivers/Linux/log.c g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/noniso.o drivers/Linux/noniso.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Print.o drivers/Linux/Print.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetClient.o drivers/Linux/EthernetClient.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SerialPort.o drivers/Linux/SerialPort.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Stream.o drivers/Linux/Stream.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/IPAddress.o drivers/Linux/IPAddress.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/compatibility.o drivers/Linux/compatibility.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetServer.o drivers/Linux/EthernetServer.cpp g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=1883 -DMY_CONTROLLER_IP_ADDRESS=10,0,10,4 -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mssub\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mspub\" -DMY_MQTT_CLIENT_ID=\"msgw\" -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o examples_linux/mysGateway.o examples_linux/mysGateway.cpp In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp: In function âvoid transportProcessMessage()â: ./core/MyTransport.cpp:535:61: error: no matching function for call to âmin(uint8_t, unsigned int)â const uint8_t msgLength = min(mGetLength(_msg), MAX_PAYLOAD); ^ ./core/MyTransport.cpp:535:61: note: candidates are: In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:535:61: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned charâ and âunsigned intâ) const uint8_t msgLength = min(mGetLength(_msg), MAX_PAYLOAD); ^ In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:535:61: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned charâ and âunsigned intâ) const uint8_t msgLength = min(mGetLength(_msg), MAX_PAYLOAD); ^ ./core/MyTransport.cpp: In function âbool transportSendWrite(uint8_t, MyMessage&)â: ./core/MyTransport.cpp:826:82: error: no matching function for call to âmin(unsigned int, const uint8_t&)â bool result = transportSend(to, &message, min(MAX_MESSAGE_LENGTH, totalMsgLength)); ^ ./core/MyTransport.cpp:826:82: note: candidates are: In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.9/bits/stl_algobase.h:240:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:826:82: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned intâ and âuint8_t {aka unsigned char}â) bool result = transportSend(to, &message, min(MAX_MESSAGE_LENGTH, totalMsgLength)); ^ In file included from /usr/include/c++/4.9/bits/char_traits.h:39:0, from /usr/include/c++/4.9/ios:40, from /usr/include/c++/4.9/ostream:38, from /usr/include/c++/4.9/iostream:39, from examples_linux/mysGateway.cpp:20: /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.9/bits/stl_algobase.h:194:5: note: template argument deduction/substitution failed: In file included from ./MySensors.h:287:0, from examples_linux/mysGateway.cpp:60: ./core/MyTransport.cpp:826:82: note: deduced conflicting types for parameter âconst _Tpâ (âunsigned intâ and âuint8_t {aka unsigned char}â) bool result = transportSend(to, &message, min(MAX_MESSAGE_LENGTH, totalMsgLength)); ^ Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed make: *** [examples_linux/mysGateway.o] Error 1 root@raspberrypi:/downloads/MySensors# -
Update: Added support for status leds (RX/TX/ERR), you can enable it in examples_linux/mysGateway.cpp file.
@marceloaqno said:
Update: Added support for status leds (RX/TX/ERR), you can enable it in examples_linux/mysGateway.cpp file.
// Flash leds on rx/tx/err
//#define MY_DEFAULT_ERR_LED_PIN 12 // Error LED pin
//#define MY_DEFAULT_RX_LED_PIN 16 // Receive LED pin
//#define MY_DEFAULT_TX_LED_PIN 18 // Transmit LED pinWhat do I put there? RPi pin numbers or GPIO numbers?
-
@marceloaqno said:
Update: Added support for status leds (RX/TX/ERR), you can enable it in examples_linux/mysGateway.cpp file.
// Flash leds on rx/tx/err
//#define MY_DEFAULT_ERR_LED_PIN 12 // Error LED pin
//#define MY_DEFAULT_RX_LED_PIN 16 // Receive LED pin
//#define MY_DEFAULT_TX_LED_PIN 18 // Transmit LED pinWhat do I put there? RPi pin numbers or GPIO numbers?
@ericvdb In any type of pin configuration for the RPi, always use the physical pin number.
-
The RPi port was merged into mysensors official repository :tada: (thank you to everyone who helped with this process :clap: ). For future discussion, please use this this topic.