1.1.0-snapshot, still having problems...
-
Happened again yesterday - won't post log as it's pretty much the same.
This time I was able to recover by powering off the pi and gw arduino, waiting 30seconds and then powering up again. So far it's all running fine again!
I may add some capacitors to help stabilise the power for the pi and arduino and see if that helps. I do have one node that 'sometimes' needs to be rebooted when it stops working. Again it may be power related. We'll see on that...
-
did you update the arduino with the gateway sketch without the inclusion button stuff?
should be commented out in either your sketch or in mysensors.h
// Enabled inclusion mode feature #define MY_INCLUSION_MODE_FEATURE // Enables inclusion-mode button feature on the gateway device #define MY_INCLUSION_BUTTON_FEATURE // Set which pin you have the inclusion button attached to #define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60
How do you power your rpi?
-
Hi @Tag
Yes I did remove the inculed button as I could not get it to work and stability is what I really need right now.
Rpi3 powered from a 5v 3A switchmode psu. Should be plenty for what it is doing...
The GW is currently using 2.2.0-beta and tomorrow I will update to 2.2.0-rc1 and see if that helps at all. I am reflashing nodes using 2.2.0-rc1 tomorrow as well, but have a couple of new ones that are driving me mad (still a lot to learn it seems)
-
Did you only remove the hardware, or also the inclusion button stuff from your sketch?
It might be that just removing the hardware is not enough....Your power supply with 3 amps should be enough have you ever tested another, sometimes the 5v coming from cheap wall plugs is not that clean... (not saying yours is cheap!!)
for what it is worth, i use a mix from 1.5x to 2.2x it works great up until now... but you can always try...
The nrf's you are using, are these with the "real" chip on it, or do you use the ones with a black round "blob" on them? I am asing, since i received these once and they gave me all kinds of issues....
Keep going!, and keep us posted!!
good luck! -
It stopped getting data again just after 4.10AM this morning....
I don't really believe it is power supply problem. The 'internal' data still continues to flow without issue, just the rf side stops suddenly without reason. Also, I can still SSH in and do whatever I need to without problem. A psu issue would probably crash the entire pi, not just one data source.....
The pa/lna I have not seen with COB yet (the blob) - and no I don't have any with 'blobs' on them!
Inclusion mode, I removed it all from the sketch and the associated HW. I will re-flash the GW today and post here exactly the code that goes into it. I may also try another pro-mini and this time solder to the board instead of adding dupont connectors, they can often be a pita!
-
Ah the pa/lna's are very very power hungry!!
Look at this thread, i have also read something about putting the radio on the 5v rail using a a stepdown converter that gets you from 5v to 3.3v.
Changing the power settings in mysensors.h is also an option
ifndef MyConfig_h #define MyConfig_h /*** * Configure Sensor Network */ #define RF24_CHANNEL 76 //RF channel for the sensor net, 0-127 #define RF24_DATARATE RF24_250KBPS //RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps #define RF24_PA_LEVEL RF24_PA_LOW //Sensor PA Level == RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm, RF24_PA_HIGH=-6dBM, and RF24_PA_MAX=0dBm #define RF24_PA_LEVEL_GW RF24_PA_LOW //Gateway PA Level, defaults to Sensor net PA Level. Tune here if using an amplified nRF2401+ in your gateway. #define BASE_RADIO_ID ((uint64_t)0xA8A8E1FC00LL) // This is also act as base value for sensor nodeId addresses. Change this (or channel) if you have more than one sensor network. // MySensors online examples defaults #define DEFAULT_CE_PIN 9 #define DEFAULT_CS_PIN 10 /*** * Enable/Disable debug logging */ #define DEBUG #endif
-
Thanks for your input and suggestions....
RE: Radio - I tried with 2 different 'normal' radios with the printed antenna first. Still had the problem.
I moved to the pa/lna in a desperate attempt to see if it would help.
The current module gets it's power from a 662k regulator (with caps). Source is the 5V out and gnd on the pi. So should be plenty of available power for this board. The RF also has it's own 47uF cap directly soldered to the power pins (small smt tantalum rated at 6.3V).
In the code the level is set to #define RF24_PA_LEVEL RF24_PA_LOW - So again should be no problem.
The RF module is about 10cm+ away from the pi too....
Here is the full gw sketch added today with the latest dev branch freshly downloaded this morning....// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 // Set LOW transmit power level as default, if you have an amplified NRF-module and // power your radio separately with a good regulator you can turn up PA level. #define MY_RF24_PA_LEVEL RF24_PA_LOW // Enable serial gateway #define MY_GATEWAY_SERIAL // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender) #if F_CPU == 8000000L #define MY_BAUD_RATE 38400 #endif // Enable inclusion mode //#define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway //#define MY_INCLUSION_BUTTON_FEATURE // Inverses behavior of inclusion button (if using external pullup) //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP // Set inclusion mode duration (in seconds) //#define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button //#define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Inverses the behavior of leds //#define MY_WITH_LEDS_BLINKING_INVERSE // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin #define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 5 // the PCB, on board LED #include <MySensors.h> void setup() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors } void loop() { // Send locally attached sensor data here }
This is exactly what is in the gw.....
I have also put multiway connectors on the dupont cables as it should add more mechanical stability (just in case something happens with the wiring) - But again this would not explain why a power cycle gets it all going again... ???
Lets see how it goes now again. -
Well this is strange indeed.
Last night all rf nodw data stopped arriiving at the controller again.
This time I simply power cycled the arduino gw and 50% of nodes started to display data again.
After half an hour this was still the case so I stopped and then started again MYC (no power off on the pi at all). Suddenly the remaining nodes started to show and this morning it's still looking good.
I'm still struggling with why this happens, especially as this would indicate it is neither the gw arduino or controller pi that is solely responsible.
Any ideas out there???
-
-
Which is kind of ironic as I moved to that setup due to the same issues with pi attached directly to radio. 3 different radio modules tested as well....
I will keep the external gateway as it allows for hardware signing for secure messages.
It doesn't narrow it down like that to me since it needed the myc controller to restart as well before things got back to normal.
/Maybe I'll add a hardware watchdog of some type, but it's difficult to decide what action it should take.
I noticed that there was no final solution on the mysensors site either. I wonder if it was ever resolved??
-
@skywatch Do you have ESP8266 module? If yes you may give a try for WiFi/MQTT.
-
Thanks -
I now have made a new build of this. New arduino pro-mini (3.3v 8MHz), rf24 PA/LNA soldered to pro mini. Brand new 32Gb Sandisk SD card flahsed with latest raspbian (updated and upgraded) - Latest mycontroller 1.1.0-SNAPSHOT - Latest mysensors 2.2.0-rc.1 ......The result?
Now I can't see any nodes at all! - I have tried to think what might be happening here.
If I attach the arduino gw to the laptop and check in serial monitor I see data arriving from the sensors, so that looks to be working. But when I attach it to the pi I get nothing.
MYC shows the gw serial connection as 'connected successfully', so where/what am I missing here?In raspi-config I selected serial = on ; serial console = off. I think thats right....?
Thanks.
-
So the story continues..... since the promini does not have a USB port, how is it connected to the PI?
What is the output of:
stty < /dev/<YOUR-DEVICE-FILE>
Change <YOUR-DEVICE-FILE> with the device file you are using....
It might be that it is set to 9600baud, while mysensors talks at 115200baud... -
pi@HAMASS:~ $ stty < /dev/serial1 -bash: /dev/serial1: Device or resource busy
Connection is from pi serial port to promini serial port. That's how it has been since I had to abandon the radio attached directly to pi version. I also added a brnad new raspberry pi 3 today as well....so eliminating hardware as much as possible.....
I have even taken one node and cleared the eeprom and reflashed with the sketch and still I get gw connected but no nodes showing. This is driving me nuts!
-
@skywatch Can you try
putty
or some other tool to monitor serial port on your Raspberry PI? -
Prior to running the stty command, did you stop mycontroller?
The reason that you do not see any data comming in is most probably due to the fact that mycontroller locked the port...
If you do not see anydata comming in it might be that mycontroller is listening at the wrong baud rate, are you using 115200 baud in mycontroller for your gateway?
This is my setup:
-
@JK - I will try this when I work it out how to do it!
@tag - Ahhh....why didn't you say 'stop myc then run this' in the first place Haha....you got me on that one
Here is the output without myc running
pi@HAMASS:~ $ sudo stty < /dev/serial1 speed 38400 baud; line = 15; min = 0; time = 0; -brkint -icrnl -imaxbel -opost -isig -icanon -iexten -echo
This matches the set up on myc gw page..... and confirmed when connecting gw to laptop with usb adapter. Does it help at all? I am still baffled by this!
-
@skywatch
can you try to change the baudrate on your GW in mycontroller to 115200, this is the speed that mysensors on your promini is using by default.... see here (unless you changed it manually in your GW sketch)You also want to make sure you are using the corect speed setting for /dev/serial1 and need to change the speed setting for /dev/serial1 to 115200 baud (see the command below)
stty -F /dev/serial1 115200
Then you know that the speed on your arduino GW, /dev/serial and mysensors controller gateway are the same. and things should start to work.....
-
Thanks for trying to help, but that would go in the wrong direction I think. I can connect the gw to the laptop and get good data at 38400 baud rate.
If you look at the mysensors gateway sketch it shows an #ifdef line for 3.3v 8MHz pro-mini to default to 38400 baud rate. Also, it was working last week like this, that is what is really puzzling me. I have swapped out rpi3, arduino, SD card, radio and cables. Things have just got worse.
The more I try to make things better, the worse they get (applies to every aspect of my life !!!)
With the festive season rapidly approaching I am getting pressed on time for this. I'll try and get time to think about this more tomorrow, but have other tasks that need to be done too.... I just thought that I still have the 'old' sd card - maybe I will try that and see.....
-
Oops, was not aware that 8mhz defaults to 38400 baud.... never too old te learn!
Something must claim /dev/serial1 before you start mycontroller...
in the meantime I will see what i can figyre out from a linux perspective.