1.1.0-snapshot, still having problems...
-
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. -
Problem solved!
Thank you both for not giving up on this - a little moral support and encouragement is very welcome during testing times!
@Tag
The 'old' SD card worked first time, so that eliminated HW issues. Then I looked into the config and saw that it was using 'serial0' - I think I got 'serial1' on the new build as it would not connect on serial0 when I first tried it, but would connect to serial1 - that was before I realised I had to enable serial on the pi to work and never thought about again after that. Doh! ...... As you say, never too old to learn (but often feels like it!)....Can I suggest that setting up serial port on pi is included in the instructions to save this happening in the future. User only needs to go raspi-config and turn on serial and turn off console. That might save some people in the future having this or similar issues.....
-
good work!!, even for "old" guys like us!
-
@tag said in 1.1.0-snapshot, still having problems...:
good work!!,
Thanks! - Nice to get back working agian....
@tag said in 1.1.0-snapshot, still having problems...:
even for "old" guys like us!
Speak for yourself!
What really puzzeled me was the fact that the gateway connected on serial1 - I didn't really give it much thought (like a usb taking a different com port for programming an arduino).....
But today I got more into the issue and it turns out that with the raspberry pi 3, bluetooth and wifi seems to be enabled by default. There is no option in raspi-config to change this either (despite Eben saying there would be last year)!....
So in this case it appears that the MYC was connecting to the bluetooth serial port on serial1 - no wonder I got no data and that also explains how it could connect to the wrong port......
I have now disabled wifi and BT in config.txt and so far so good.....No errors in the MYC logs and no java errors yet either..... I am currently hopeful for this build!
As you say - never too old to learn!
-
8 Days and looking good - no errors, no crashes. Just a couple of nodes that misbehave sometimes......
On that note, today I noticed one node had not sent data for many hours and when I got to it, the led connected to pin 13 was rapidly flashing. This is not normally the case, but I can't spare the laptop to monitor the serial port for a week+ just in case it happens again - any ideas? This was using the standard MYS prog for bmp180 pressure sensor. Running on mains powered 5v pro mini.