@jkandasa Maybe I misunderstood the meaning of this class, but what about "message" instead of "field"?
Posts made by Daniele
-
RE: Your suggestions to choose naming for "sensor" and "variable"
-
RE: Your suggestions to choose naming for "sensor" and "variable"
@skywatch source and value looks very good to me!
-
RE: Communication between 2 pi each running mycontroller
@skywatch you could probably exchange messages thru MQTT queues, but being you I'd really invest my energies understanding how to use 2 gateways, since this is the standard way and you'll probably get more support for the community.
By the way, I have 4 gateways in my home (due to connectivity issue caused by concrete walls) and I never had issues with that in MyController. -
RE: Communication between 2 pi each running mycontroller
@skywatch why do you need 2 instances?
If they are on the same ethernet netword, can't you configure one of them to use 2 gateways? -
Log full of javax.net.ssl.SSLException errors
Hi,
could someone help me understanding what this error means and how to get rid of it?
Every day my log is full of messages like this:IO error: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown in processing a request from /192.168.1.12:8443 / sun.security.ssl.SSLSocketImpl
I read other posts telling is was related to some script under "HTML additional headers", but that section is completely empty in my case.
It's probably something simple about https certificates, but I don't have any experience on this kind of things...Thanks
Daniele -
RE: Unique index or primary key violation: "CONSTRAINT_4B_INDEX_4 ON PUBLIC.METRICS_DOUBLE_TYPE_DEVICE
If others will arrive here searching for a similar issue: in my case the final solution has been changing the Arduino Uno I was using as ethernet gateway.
-
Rule status in dashboard
I'd like to be able to enable / disable a rule from my dashboard.
I could probably create a mock variable and then with a script change the status of the rule based on the variable value.
I was just wondering if there's a more elegant way to achieve the same result.
Thanks
Daniele -
RE: Unique index or primary key violation: "CONSTRAINT_4B_INDEX_4 ON PUBLIC.METRICS_DOUBLE_TYPE_DEVICE
@jkandasa sorry to re-open an hold discussion.
the same error appeared again, and this time the gateway hard reset did not solve it.
do you have any idea on how to better isolate the issue?
thanks
Daniele -
RE: Frequent errors related to Ethernet Gateways
@Avamander could you please post me an example of DHCP renewal?
I investigated the ICMP ping idea but I've not been able to get something working, since the ping seems to interfere with GW code. Did you manage to use it in a mysensors GW? -
RE: Frequent errors related to Ethernet Gateways
I can confirm, chinese nano bootloader does not support watchdog.
All my nanos have MySBootloader (for this reason and to be able to use OTA update), but I don't want to use it on GWs since it takes 10-15 seconds to start because it searches for a GW in order to chech new OTA updates.
What I tried is to enable watchdog on a Uno (which in my experiments seems to support watchdog), but till now I haven't found a good way to check ethernet connectivity without interfering with GW functioning.
Do you have any idea on that?
Thanks
Daniele -
RE: Frequent errors related to Ethernet Gateways
@skywatch said in Frequent errors related to Ethernet Gateways:
d tried a 'new SD' card, did you flash tha
fresh install
-
RE: Frequent errors related to Ethernet Gateways
@skywatch done multiple times during my tests, but nothing changed!
-
RE: Frequent errors related to Ethernet Gateways
@jkandasa said in Frequent errors related to Ethernet Gateways:
our MySensors gateway ethernet device attached with Arduino
That's the same thing I thought, but having 4 of them all failing sounds a bit odd....
That's why I started looking also on the RPI side.
I tried also moving the ethernet cables from the swtich to the main router, to understand if the switch is having some issue, but still getting the same issues. -
RE: Frequent errors related to Ethernet Gateways
@jkandasa I've not been clear: could you please explain what's the difference between "Broken pipe" and "Connection reset" errors?
I yet tried with the old firmware, but I get the same errors, so the issue is somewhere else. =(
-
RE: Frequent errors related to Ethernet Gateways
I made many tests in these days.
On the arduino side:
- downgrading mysensors library
- reducing and than disabling the RF24 message buffer feature
- Soft SPI
- adding capacitors to get a more stable power
On the RPI side:
- moved the ethernet connection from a switch to the main router
- moved from ethernet to wifi (to understand if there could be any issue on the RPI ethernet port)
- upgrading to mycontroller 1.5
- new SD card
I still see ethernet related errors, but now the message is slightly different, it talks about connection reset instead of broken pipe:
2020-04-14 10:04:42,138 ERROR [mc-th-pool-4] [org.mycontroller.standalone.gateway.ethernet.EthernetDriver:107] Exception, java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115) at java.net.SocketOutputStream.write(SocketOutputStream.java:143) at org.mycontroller.standalone.gateway.ethernet.EthernetDriver.write(EthernetDriver.java:104) at org.mycontroller.standalone.gateway.ethernet.GatewayEthernet.write(GatewayEthernet.java:44) at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:229) at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:133) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
@jkandasa could you please give me more details about the meaning of the 2 error messages?
Thanks
Daniele -
RE: Frequent errors related to Ethernet Gateways
@jkandasa I restart MyController Raspberry regularly (scheduled once per week), I tried doing that manually but nothing changed.
No changes on the router, but you made me remember I recently re-uploaded the sketches of my gateways and in this way I upgraded their mysensors library version.
I'll try downgrade one of them and see if this helps. -
RE: Unique index or primary key violation: "CONSTRAINT_4B_INDEX_4 ON PUBLIC.METRICS_DOUBLE_TYPE_DEVICE
@jkandasa it's probably related to some gateway issue, probably connected to the issue I asked here
I made a hard restart of the gateway and now the error disappeared.
Thank you! -
Frequent errors related to Ethernet Gateways
In the last week I often receive errors like this:
2020-04-03 09:03:30,572 ERROR [mc-th-pool-7] [org.mycontroller.standalone.gateway.ethernet.EthernetDriver:107] Exception, java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) at java.net.SocketOutputStream.write(SocketOutputStream.java:143) at org.mycontroller.standalone.gateway.ethernet.EthernetDriver.write(EthernetDriver.java:104) at org.mycontroller.standalone.gateway.ethernet.GatewayEthernet.write(GatewayEthernet.java:44) at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:229) at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:133) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
I have 4 ethernet gateways, 3 based on Arduino Uno + W5100 Shield and 1 with Arduino Nano + W5500.
They never gave me a problem for more than 1 year, and now they're all suddenly showing connection problems.
I tried changing the ethernet cables and moving them to a different ethernet port: same errors.
They're connected to the same swtich I use for my laptop and I don't see issues, so I don't expect to be the switch.Any idea?
Thanks
Daniele -
RE: Unique index or primary key violation: "CONSTRAINT_4B_INDEX_4 ON PUBLIC.METRICS_DOUBLE_TYPE_DEVICE
/* * MySBootloader 1.3.0 16 MHz * * 9-13 NRF24 (standard mysensors) * 1 PIR * 2 temperatura (DS18B20) */ #define MY_DEBUG #define MY_DEBUG_DETAIL #define MY_NODE_ID 3 #define CHILD_ID_PIR 1 #define CHILD_ID_TEMP 2 #define pirPin 8 #define TempPin 2 #include <MyRF24_P0_GW2.h> #include <MySensors.h> #include <MyCircularBuffer.h> #include <OneWire.h> #include <DallasTemperature.h> #define wdt_check_min 10; #define wdt_check_max 150; #include <MyWDT.h> OneWire oneWire(TempPin); DallasTemperature sensors(&oneWire); DeviceAddress ds18Addr; MyMessage msgPIR(CHILD_ID_PIR, V_TRIPPED); MyMessage msgTEMP(CHILD_ID_TEMP, V_TEMP); int nNoUpdatesPIR = 0, nNoUpdatesTEMP = 0; unsigned const int FORCE_UPDATE_N_READS = 300; unsigned int calibrationTime = 10; unsigned int p; unsigned int p_tot; float temp, last_temp = 0, tempTot = 0; unsigned int msg; unsigned int last_msg = 9; //per forzare primo invio unsigned const int loop_cycles = 60; unsigned const int loop_wait = 1; //secondi tra ogni rilevazione del PIR /* unsigned int wdt_failures = 0; unsigned int wdt_check_interval = 30; unsigned int wdt_loops = 0; unsigned int wdt_uplink = 0; */ MyCircularBuffer<byte,loop_cycles> pirBuffer; MyCircularBuffer<float,10> TempBuffer; //CircularBuffer<byte,3> wdtBuffer; void setup() { wdt_disable(); pinMode(pirPin, INPUT); digitalWrite(pirPin, LOW); //Fase di calibrazione Serial.print("Calibrating sensor "); for(int i = 0; i < calibrationTime; i++){ Serial.print("."); p = digitalRead(pirPin); pirBuffer.push(p); delay(1000); } Serial.println(" done"); Serial.println("SENSOR ACTIVE"); delay(50); sensors.begin(); if (!sensors.getAddress(ds18Addr, 0)) Serial.println("Unable to find address for Device 0"); sensors.setResolution(ds18Addr, 11); wdt_enable(WDTO_4S); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("P0 - PIR Studio", "1.1"); present(CHILD_ID_PIR, S_MOTION, "P0 PIR Studio"); present(CHILD_ID_TEMP, S_TEMP, "P0 Temperatura Studio"); } void loop() { p = digitalRead(pirPin); pirBuffer.push(p); p_tot = 0; for(int i=0; i<pirBuffer.size(); i++){ p_tot += pirBuffer[i]; } if(p_tot > loop_cycles/4){ msg = 1; } else { msg = 0; } if (msg != last_msg || nNoUpdatesPIR == FORCE_UPDATE_N_READS) { last_msg = msg; nNoUpdatesPIR = 0; send(msgPIR.set(msg), true); #ifdef MY_DEBUG Serial.print("P: "); Serial.println(msg); #endif } else { nNoUpdatesPIR++; } //check external temp sensors.requestTemperatures(); wait(1000); //temp = sensors.getTempCByIndex(0); temp = sensors.getTempC(ds18Addr); if(temp != DEVICE_DISCONNECTED_C) TempBuffer.push(temp); tempTot = 0; for(int i=0; i<TempBuffer.size(); i++){ tempTot += TempBuffer[i]; } tempTot = tempTot / TempBuffer.size(); if (abs(tempTot - last_temp) > 0.1 || nNoUpdatesTEMP == FORCE_UPDATE_N_READS) { last_temp = tempTot; nNoUpdatesTEMP = 0; send(msgTEMP.set(tempTot,1), true); #ifdef MY_DEBUG Serial.print("T avg: "); Serial.println(tempTot); #endif } else { nNoUpdatesTEMP++; } #ifdef MY_DEBUG_DETAIL Serial.print("T: "); Serial.print(temp); Serial.print(" - P:"); Serial.println(p); #endif wait(loop_wait * 1000); //wdt uplink check wdt_check(); }
-
RE: Unique index or primary key violation: "CONSTRAINT_4B_INDEX_4 ON PUBLIC.METRICS_DOUBLE_TYPE_DEVICE
This morning I was checking the resource logs , and I noticed some odd behaviour I cannot explain:
The same temperature is transmitted twice at the same timestamp, but my sketch reads the temperature once per second and sends it only when the absolute difference from the previous value is greater than 0.1°C.
This setup is in place from more than 1 year, and I never saw this beahaviour...
Any idea?