Adding a capacitor hasn't helped.
I changed the setup using now a serial gateway on a separate Arduino instead of having it directly on the Pi. This is working fine. So it seems that the serial gateway on the Pi was the problem..
thomas1412
@thomas1412
Best posts made by thomas1412
-
RE: Sending image-data over the MySensors network.
Latest posts made by thomas1412
-
RE: Sending image-data over the MySensors network.
Adding a capacitor hasn't helped.
I changed the setup using now a serial gateway on a separate Arduino instead of having it directly on the Pi. This is working fine. So it seems that the serial gateway on the Pi was the problem.. -
RE: Sending image-data over the MySensors network.
Hi,
thanks for the quick reply and your help
It turned out my problem was the not installed serialport perl library.. Now I'm a step further.
Unfortunately there's another problem now..
After sending three or four packages the next six packages are failing to send. And this over and over again.
Seems that the SerialGateway is too slow in some way..send: 254-254-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.1 send: 254-254-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 sensor started, id=254, parent=0, distance=1 send: 254-254-0-0 s=3,c=0,t=23,pt=0,l=0,sg=0,st=ok: Sending Picture of 13048 Bytes. send: 254-254-0-0 s=3,c=1,t=25,pt=0,l=5,sg=0,st=ok:START send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=ok:FFD8FFFE00244900020D0000000000000000000000000000 send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=ok:00F0004001070032120B510451040000FFDB008400020101 send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=ok:020101020201020202020203040303020203050404030406 send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=fail:0607070606060607080A0907070A080606090C090A0A0B0B send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=fail:0B0B07080C0D0C0B0D0A0B0B0B0102020203020305030305 send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=fail:0B0706070B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=fail:0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=fail:0B0B0B0B0B0BFFFE0005000000FFC000110800F001400301 send: 254-254-0-0 s=3,c=1,t=24,pt=6,l=24,sg=0,st=fail:2100021101031101FFC401A2000001050101010101010000```
-
RE: Sending image-data over the MySensors network.
Hi,
I'm currently trying to use your solution, @Oitzu.
The Node-part is working fine. Have a little problem on the Pi-side.
The RF-device is directly connected to the Pi, so I'm using a Serial Gateway script on the Pi (https://github.com/mysensors/Raspberry). The serial data is then send over /dev/ttyUSB20, that is working fine.
I know that I need to adjust the following lines of the Perl script:use Device::SerialPort; use POSIX qw(strftime); use Data::Dumper; use Time::HiRes qw (sleep); use Time::HiRes qw(time); my $port = Device::SerialPort->new("/dev/ttyUSB1");
But it seems I'm just to stupid to do this by myself
I would suggest that I can delete the first line and change the last line to something like this:my $port = "/dev/ttyUSB20";
Can someone help me with the right syntax?
Thanks!
-
Start/stop sequence
Hi,
I have an Arduino which controls a relay with 8 channels. The channels are switching on and off one after another. Just like this, very simple:
digitalWrite(RELAY1,LOW); delay(2000); digitalWrite(RELAY1,HIGH); digitalWrite(RELAY2,LOW); delay(2000); digitalWrite(RELAY2,HIGH);
Now I want to control this application over RF/MySensors so that I can send a signal over RF to the Arduino to start or stop the sequence.
My first idea was just to extend the RelayActuator-code by an if-loop. I used gw.loadState to check whether the sequence should start or not, but this is truly wrong..#include <MySigningNone.h> #include <MyTransportNRF24.h> #include <MyTransportRFM69.h> #include <MyHwATMega328.h> #include <MySensor.h> #include <SPI.h> #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 1 // Total number of attached relays #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 radio; // Message signing driver (none default) //MySigningNone signer; // Select AtMega328 hardware profile MyHwATMega328 hw; // Construct MySensors library MySensor gw(radio, hw); void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Relay", "1.0"); // Fetch relay status for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); } } void loop() { // Alway process incoming messages whenever possible gw.process(); if (gw.loadState(1)==1) { Serial.println("on"); digitalWrite(RELAY_1,LOW); } if (gw.loadState(1)==0) { Serial.println("off"); digitalWrite(RELAY_1,HIGH); } delay(100); } void incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom gw.saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
Any idea how I get this working?
Thanks!
-
RE: Raspberry Pi Gateway
@alexsh1
Is the MySensorsGateway + Domoticz now working on your installation?
Have the similar problem you mentioned above.
A sensor node is sending data to the Gateway. The data appears in the console, even if there are some "fail".
I linked the ttyMySensorsGateway to ttyUSB20. It appears in the Domoticz Setup when adding MySensorsGateway USB. Everything's fine so far, but the node don't appear in the Device section of the setup.
Have you solved this problem?