💬 Building a Raspberry Pi Gateway
-
Possibly same problem with Domoticz here too. Using a directly attached NRF24 radio to a Raspberry Pi Zero W.
I tried to remake using the latest dev code, and got this error:
gcc -MT build/drivers/BCM/bcm2835.o -MMD -MP -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DMY_RADIO_NRF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI -DMY_PORT=5003 -DMY_RF24_PA_LEVEL=RF24_PA_LOW -Ofast -g -Wall -Wextra -I. -I./core -I./drivers/Linux -I./drivers/BCM -c drivers/BCM/bcm2835.c -o build/drivers/BCM/bcm2835.o drivers/BCM/bcm2835.c: In function ‘bcm2835_delayMicroseconds’: drivers/BCM/bcm2835.c:441:40: error: expected ‘)’ before ‘PRIu64’ printf("bcm2835_delayMicroseconds %" PRIu64 "\n", micros); ^ drivers/BCM/bcm2835.c:441:40: warning: spurious trailing ‘%’ in format [-Wformat=] Makefile:102: recipe for target 'build/drivers/BCM/bcm2835.o' failed make: *** [build/drivers/BCM/bcm2835.o] Error 1// commenting out the problem allowed make to finish:
//if (debug) { // /* Cant access sytem timers in debug mode */ // printf("bcm2835_delayMicroseconds %" PRIu64 "\n", micros); // return; //}This is my config:
./configure --my-transport=nrf24 --my-rf24-pa-level=RF24_PA_LOW --my-gateway=ethernet --my-port=5003 -
Hello all!
I'm trying to build a gateway with a Raspberry pi2, ethernet and Domoticz.
It looks like the gateway is beeing built ok and seems to run fine but nodes can not communicate with it.
I have read most of the postings here but I can not find any solution.
Hope you guys can help? Please!I run raspbian (Jessie) pi@raspberrypi:~/MySensors/bin $ uname -a Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/LinuxUsing master branch
https://www.mysensors.org/build/raspberry git clone https://github.com/mysensors/MySensors.git --branch masterConfiguring like this
pi@raspberrypi:~/MySensors $ ./configure --my-gateway=ethernet --my-port=5003 --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 [SECTION] Detecting target machine. [OK] machine detected: SoC=unknown, Type=unknown, CPU=armv7l. [SECTION] Checking GPIO Sysfs. [OK] /sys/class/gpio/export found [SECTION] Detecting SPI driver. [OK] SPI driver detected:SPIDEV. [SECTION] Detecting init system. [OK] init system detected: systemd. [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished.Obs! No Raspberry identification, why not? Maybe that is the culprit?
After make I start the gateway and get this:pi@raspberrypi:~/MySensors $ cd bin pi@raspberrypi:~/MySensors/bin $ sudo ./mysgw -d mysgw: Starting gateway... mysgw: Protocol version - 2.1.1 mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1 mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: Listening for connections on 0.0.0.0:5003 mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1 mysgw: New connection from 127.0.0.1 mysgw: Client 0 connected mysgw: Client 0: 0;0;3;0;2; mysgw: Client 0: 0;0;3;0;2;Get Version mysgw: Client 0: 0;0;3;0;18;PINGSeems nice and dandy and Domoticz connecting fine.
Trying with this example node:#define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_LOW #define MY_DEBUG #define MY_NODE_ID 42 //#define MY_DEBUG_VERBOSE_RF24 #define MY_BAUD_RATE 9600 #include <MySensors.h> #include<Arduino.h> #define OPEN 1 #define CLOSE 0 #define CHILD_ID 1 MyMessage msg(CHILD_ID, V_TRIPPED); uint8_t value = OPEN; void setup() { Serial.print("setup()\n"); } void presentation() { sendSketchInfo("Door", "2.1.1"); present(CHILD_ID, S_DOOR); Serial.print("presentation()\n"); } void loop() { value = value == OPEN ? CLOSE : OPEN; send(msg.set(value)); Serial.print("message sent"); Serial.print(value + "\n"); sleep(1000); }And recieve this when running:
--- Miniterm on /dev/ttyUSB0 9600,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- 0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1 40 TSM:INIT 55 TSF:WUR:MS=0 77 TSM:INIT:TSP OK 96 TSM:INIT:STATID=42 120 TSF:SID:OK,ID=42 141 TSM:FPAR 190 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2267 !TSM:FPAR:NO REPLY 2291 TSM:FPAR 2340 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4417 !TSM:FPAR:NO REPLY 4442 TSM:FPAR 4491 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6569 !TSM:FPAR:NO REPLY 6594 TSM:FPAR 6643 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8720 !TSM:FPAR:FAIL 8740 TSM:FAIL:CNT=1 8761 TSM:FAIL:PDTAnd no output in gateway either.
Both radio modules using capacitors.What have I missed?
Thanks, Andreas!
-
I tried for months to get a stable working nrf24 attached to pi to act as a gw and controller.
In the end I gave up and now have a 3.3V 8MHz pro mini gw attached to the pi. I took 0v and 5v from the pi (via a 3.3v buck converter) and serial tx and rx. Only 4 wires needed and has been as stable as can be for over a week now.
Maybe help someone with the same unsolveable problems?
-
Hello all!
I'm trying to build a gateway with a Raspberry pi2, ethernet and Domoticz.
It looks like the gateway is beeing built ok and seems to run fine but nodes can not communicate with it.
I have read most of the postings here but I can not find any solution.
Hope you guys can help? Please!I run raspbian (Jessie) pi@raspberrypi:~/MySensors/bin $ uname -a Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/LinuxUsing master branch
https://www.mysensors.org/build/raspberry git clone https://github.com/mysensors/MySensors.git --branch masterConfiguring like this
pi@raspberrypi:~/MySensors $ ./configure --my-gateway=ethernet --my-port=5003 --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 [SECTION] Detecting target machine. [OK] machine detected: SoC=unknown, Type=unknown, CPU=armv7l. [SECTION] Checking GPIO Sysfs. [OK] /sys/class/gpio/export found [SECTION] Detecting SPI driver. [OK] SPI driver detected:SPIDEV. [SECTION] Detecting init system. [OK] init system detected: systemd. [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished.Obs! No Raspberry identification, why not? Maybe that is the culprit?
After make I start the gateway and get this:pi@raspberrypi:~/MySensors $ cd bin pi@raspberrypi:~/MySensors/bin $ sudo ./mysgw -d mysgw: Starting gateway... mysgw: Protocol version - 2.1.1 mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1 mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: Listening for connections on 0.0.0.0:5003 mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1 mysgw: New connection from 127.0.0.1 mysgw: Client 0 connected mysgw: Client 0: 0;0;3;0;2; mysgw: Client 0: 0;0;3;0;2;Get Version mysgw: Client 0: 0;0;3;0;18;PINGSeems nice and dandy and Domoticz connecting fine.
Trying with this example node:#define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_LOW #define MY_DEBUG #define MY_NODE_ID 42 //#define MY_DEBUG_VERBOSE_RF24 #define MY_BAUD_RATE 9600 #include <MySensors.h> #include<Arduino.h> #define OPEN 1 #define CLOSE 0 #define CHILD_ID 1 MyMessage msg(CHILD_ID, V_TRIPPED); uint8_t value = OPEN; void setup() { Serial.print("setup()\n"); } void presentation() { sendSketchInfo("Door", "2.1.1"); present(CHILD_ID, S_DOOR); Serial.print("presentation()\n"); } void loop() { value = value == OPEN ? CLOSE : OPEN; send(msg.set(value)); Serial.print("message sent"); Serial.print(value + "\n"); sleep(1000); }And recieve this when running:
--- Miniterm on /dev/ttyUSB0 9600,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- 0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1 40 TSM:INIT 55 TSF:WUR:MS=0 77 TSM:INIT:TSP OK 96 TSM:INIT:STATID=42 120 TSF:SID:OK,ID=42 141 TSM:FPAR 190 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2267 !TSM:FPAR:NO REPLY 2291 TSM:FPAR 2340 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4417 !TSM:FPAR:NO REPLY 4442 TSM:FPAR 4491 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6569 !TSM:FPAR:NO REPLY 6594 TSM:FPAR 6643 TSF:MSG:SEND,42-42-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8720 !TSM:FPAR:FAIL 8740 TSM:FAIL:CNT=1 8761 TSM:FAIL:PDTAnd no output in gateway either.
Both radio modules using capacitors.What have I missed?
Thanks, Andreas!
-
@aglock I put a note on the raspberry gateway page to use latest development in case of problems with stable. Did you try?
-
@aglock I put a note on the raspberry gateway page to use latest development in case of problems with stable. Did you try?
@gohan Tried it again
configure now recognizes the rpi:pi@raspberrypi:~/mys_dev $ ./configure --my-gateway=ethernet --my-port=5003 --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2836, Type=rpi2, CPU=armv7l. [SECTION] Detecting SPI driver. [OK] SPI driver detected:BCM. [SECTION] Detecting init system. [OK] init system detected: systemd. [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished.But make fails with the following error:
-I./core -I./drivers/Linux -I./drivers/BCM -c drivers/BCM/bcm2835.c -o build/drivers/BCM/bcm2835.o drivers/BCM/bcm2835.c: In function ‘bcm2835_delayMicroseconds’: drivers/BCM/bcm2835.c:441:40: error: expected ‘)’ before ‘PRIu64’ printf("bcm2835_delayMicroseconds %" PRIu64 "\n", micros); ^ drivers/BCM/bcm2835.c:441:40: warning: spurious trailing ‘%’ in format [-Wformat=] Makefile:102: recipe for target 'build/drivers/BCM/bcm2835.o' failed make: *** [build/drivers/BCM/bcm2835.o] Error 1 pi@raspberrypi:~/mys_dev $What to do about it?
-
@gohan Tried it again
configure now recognizes the rpi:pi@raspberrypi:~/mys_dev $ ./configure --my-gateway=ethernet --my-port=5003 --my-transport=nrf24 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 [SECTION] Detecting target machine. [OK] machine detected: SoC=BCM2836, Type=rpi2, CPU=armv7l. [SECTION] Detecting SPI driver. [OK] SPI driver detected:BCM. [SECTION] Detecting init system. [OK] init system detected: systemd. [SECTION] Saving configuration. [SECTION] Cleaning previous builds. [OK] Finished.But make fails with the following error:
-I./core -I./drivers/Linux -I./drivers/BCM -c drivers/BCM/bcm2835.c -o build/drivers/BCM/bcm2835.o drivers/BCM/bcm2835.c: In function ‘bcm2835_delayMicroseconds’: drivers/BCM/bcm2835.c:441:40: error: expected ‘)’ before ‘PRIu64’ printf("bcm2835_delayMicroseconds %" PRIu64 "\n", micros); ^ drivers/BCM/bcm2835.c:441:40: warning: spurious trailing ‘%’ in format [-Wformat=] Makefile:102: recipe for target 'build/drivers/BCM/bcm2835.o' failed make: *** [build/drivers/BCM/bcm2835.o] Error 1 pi@raspberrypi:~/mys_dev $What to do about it?
-
@mfalkvidd Wow, thanks that works! :D
-
Got mysensors gateway working on gpio of my Pi again using ./configure --my-transport=nrf24 --my-rf24-irq-pin=15 --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18 --my-gateway=ethernet --my-port=5003
However on tx or tx always the two leds connected to pin 16 and 18 are lit. More people with the same problem?
-
Got mysensors gateway working on gpio of my Pi again using ./configure --my-transport=nrf24 --my-rf24-irq-pin=15 --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18 --my-gateway=ethernet --my-port=5003
However on tx or tx always the two leds connected to pin 16 and 18 are lit. More people with the same problem?
-
Can we use the "debug ota log" features with the raspberryPi gateway ??
My node is not accessible and runs MYSBootloader.
My gateway is raspberryPI.Now, I need to update the firmware on my node. Via MYSController, no problems, upload runs like a charm.
But how to do for debugging my sketch ? Some bugs appear...... , I need to take a look on some vars values.
Usually, I use the serial port with serial.print(some vars).
Which alternative I have to use without serial port, only OTA features ?Thanks for the great work !!
-
In fact, I do not need to log, but need to look what's happen in my sketch.
The new "OTALog" function, MY_OTA_LOG_SENDER_FEATURE or MY_DEBUG_OTA seems to be the good way.
From the docs, it allows to send a debug message to another node or gateway via OTA.But how to got the debug message from OTA node, on the gateway side (RaspberryPi) ?
-
@romeo01 said in 💬 Building a Raspberry Pi Gateway:
MY_DEBUG_OTA
I'd start reading from here https://www.mysensors.org/apidocs-beta/group__SerialDebugGrpPub.html#ga6bd5956352d3a184a0cb02783b8d35ff
-
@romeo01 said in 💬 Building a Raspberry Pi Gateway:
MY_DEBUG_OTA
I'd start reading from here https://www.mysensors.org/apidocs-beta/group__SerialDebugGrpPub.html#ga6bd5956352d3a184a0cb02783b8d35ff
@gohan said in 💬 Building a Raspberry Pi Gateway:
@romeo01 said in 💬 Building a Raspberry Pi Gateway:
MY_DEBUG_OTA
I'd start reading from here https://www.mysensors.org/apidocs-beta/group__SerialDebugGrpPub.html#ga6bd5956352d3a184a0cb02783b8d35ff
Well, you found the starting point !
MY_OTA_LOG_SENDER_FEATURE & MY_DEBUG_OTA are enabled on my OTA node.
Again the same question: What I have to do on the gateway side ?
Is it possible with the raspberry Gateway ?I'm still looking for debugging my sketch in remote. I need to have a look on the debug messages. I reminder, the node is not accessible and runs MYSbootloader.