[SOLVED] Serial problem
-
I've taken the HW apart for now as I had issues again - I will re-build asap and will get the log files for you then. Shouldn't be too long I hope!
-
You are correct in your thinking - I have looked at the whole log and there are numerous occasions where I see a space between (or after on single digit) numbers.
I'll email the log to you..... And below is the result of better cooling on the mycontroller pi3.......
Before....
After... One biggie to cool the CPU and controller....
I did the same to a pi3 running seti @ home on all four cores 24/7 and it hasn't creashed since(!), so here's hoping for this one.....Best of all it still fits in the case!
-
@skywatch I see the following junk char in the log, I do not know how this is happening,
- Problem with serial gateway/recent MySensors library?
- Problem with JSerialComm driver?
Let me try to build recent JSerialComm driver for you.
-
@jkandasa - Well, not so much of a puzzle now then
Don't worry about the 'nan' values - I can filter them at the node (have modified the code but not had time to upload it as node is builit in to equimpent and soon I will change the sensors to a different type anyway). - Will do that this weekend as it is going to rain here now.....
It is really only the corrupted strings that it would be good to stop, if possible.
-
It has been 10 hours now without any problems. I did think of lowering the serial baud rate to 19200 and see if that helps. I could also replace the pro mini with another one and see if that helps. But I will give it more time and see how it goes.
-
@skywatch So I got another corrupted string today and now I have lowered the serial baud rate to 19200 between GW and MyC...... I'll let you know the result!
-
Reducing serail baud rate had no effect. Still getting corrupted data on the first value of the raw data - I'll have to have another think about this one!
-
@skywatch ok, The corrupted data only reports in node id right?
-
@skywatch I have added a workaround for number issue, Can you check it in the SNAPSHOT version?
-
@jkandasa Yes - oddly it is only the node ID that seems to be corrupted with junk characters...
-
I have the snapshot version now, thank you - I want to see how it goes for a day first as I have modified the pi slightly and want to see what effect, if any, that has first.
As always I will let you know how it goes in a few days!
-
Just a quick update - 25 hours and no corrupted node id's, so I am optimistic on the mod.......But, at 6.30AM all data stopped flowing from all nodes - a disconnect and re-connect of the GW pro mini and all came back....hmmm.
-
Just a quick update - 25 hours and no corrupted node id's, so I am optimistic on the mod.......
Can you share what change needs in hardware to resolve this issue?
But, at 6.30AM all data stopped flowing from all nodes - a disconnect and re-connect of the GW pro mini and all came back....hmmm.
Did gateway reconnect automatically? Can you email me the mycontroller.log file?
-
@jkandasa - Gateway reconnected automatically.
It all went bad today - I tried a new 5v pro mini GW (with level shifter for data lines) and that failed miserably. So I made a new 3.3V pro mini GW and a new 3.3v regulator board, and have spent the last 7 hours trying to get things working again.
Sadly I think this will require a full reinstall, losing all data from the hot summer and taking more time than I have available to put into it. Just as it was looking hopeful too......
I'm gutted.
P.S. Hardware (Rpi3). Add a 100n capacitor across the 5VDC input on the back of the pi (points to attach to are PP2 and PP5). It will filter out spikes on the power input to the pi. An 0805 SMD ceramic multilayer cap is what I used and I suggest the same for anyone else - but I take no resoposibility if you break a pi - do it at your own risk and only if competent to do so.
-
At 21.30 I got it back to working again with a different 3.3v pro mini as GW, at 22.50 I got the first corrupted node data and at 23.45 all data from remote nodes stopped again and it remained in this state until half an hour ago when I powered down/ powered up the pi.
-
@skywatch Can you share your hardware(serial gateway) and power supply details?
-
@jkandasa Sure!
Gateway using mysensors 2.3.0.......
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * DESCRIPTION * The ArduinoGateway prints data received from sensors on the serial link. * The gateway accepts input on seral which will be sent out on radio network. * * The GW code is designed for Arduino Nano 328p / 16MHz * * Wire connections (OPTIONAL): * - Inclusion button should be connected between digital pin 3 and GND * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series * * LEDs (OPTIONAL): * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * */ // Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#ifndef MY_RF24_CHANNEL #define MY_RF24_CHANNEL (97) //#endif #define MY_RX_MESSAGE_BUFFER_FEATURE #define MY_RF24_IRQ_PIN 2 // 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_HIGH // 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 }
Power is from official raspberry pi power supply - I'll check the rating when I power it down later on tonight.
-
you are using a 3.3v promini as a GW.... 2 questions...
-
how do you get the data from the promini into the RPI, how is that wired since the promini does not have an USB port...
-
the GW sketch you posted is designed for an arduino nano 16Mhz, if you use a 3.3v promini it needs run at 8Mhz... Try to make this change in the GW sketch to hardcode the 8Mhz feature. It might be that the cpu freq in the if statement is not picked up bt the compiler, so try with the if statements removed.
// 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
to
// 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
Can you try an arduino nano + NRF24L01 as gateway, and connect it to USB (if you have one lying around)
Just as background info, my 1st mycontroller setup was an RPI 2b with an arduino nano on usb that acted as a GW... had this setup for years and it worked flawless, other versions of the SW, but still....
-
-
Thanks for the reply. In answer to your questions.....
-
The pro mini is connected via serial connection to the pi (tx/rx on pro mini to tx/rx on pi). I chose 3.3v pro mini as then there is no level shifter needed.
-
It is definitely being picked up by the compiler as the serial rate between the pi and promini works at 38400. If this were not picked up I would expect 115200. I don't have a nano anywhere, but could try a uno or mega.
I now am running on a 'Pi Hut' 5V 2A supply and have had 2 junk node id's already this morning (But this time both from the same node I think, so will look into that as well). I am also going to see what good power supplies RS Components has and probably add a mains filter as well.
-
-
Ah okay!,
Well, it might work this way, but sometime ago I ran into issues with serial comms where the TTL level between high and low was different between systems, and had to use a pull down resistor to fix this...Another solution is to remove the arduino from the equation... it is possible to use plug the radio directly on the GPIO header of the RPI.. For a howto look here
Got this working for over a year now on and OPI zero and it works as expected.....