Posts made by heggrik
-
Can't get my new mysensors LED-Dimmer to show up.
So i've been having this issue for a few days now when trying to add my new pwm-led dimmer to Home-assistant.
I cleared the eeprom and used the included mysensors example sketch and uploaded it to the arduino, started it and immediately got the error "child_id X already exists in children of node X, cannot add child"
so i enabled the debugging in home-assistant and i have the logs provided.
home-assistant log:
2017-08-19 12:11:30 INFO (MainThread) [homeassistant.loader] Loaded sensor.mysensors from homeassistant.components.sensor.mysensors 2017-08-19 12:11:30 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mysensors 2017-08-19 12:11:38 INFO (Thread-13) [mysensors.gateway_tcp] Trying to connect to ('127.0.0.1', 5003) 2017-08-19 12:11:38 INFO (Thread-13) [mysensors.gateway_tcp] Connected to ('127.0.0.1', 5003) 2017-08-19 12:11:38 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;14;Gateway startup complete. 2017-08-19 12:11:38 INFO (Thread-13) [mysensors] n:0 c:255 t:3 s:14 p:Gateway startup complete. 2017-08-19 12:11:38 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 255;255;3;0;20; 2017-08-19 12:11:38 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:11:39 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:11:48 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:11:48 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:11:58 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:11:58 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:12:08 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:12:08 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:12:09 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 2;255;0;0;17;2.1.1 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 2, child 255 sub_type 17 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 2;255;3;0;6;M 2017-08-19 12:12:09 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 2;0;0;0;4; 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 2, child 0 sub_type 4 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 2 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 2, child 255 sub_type 11 2017-08-19 12:12:09 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 2;255;3;0;12;1.1 2017-08-19 12:12:09 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 2, child 255 sub_type 12 2017-08-19 12:12:18 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:12:19 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:12:28 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:12:29 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:12:38 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:12:39 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:12:48 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:12:49 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:12:59 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:12:59 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1 2017-08-19 12:13:09 DEBUG (Thread-13) [mysensors.gateway_tcp] Sending 0;255;3;0;2; 2017-08-19 12:13:09 DEBUG (Thread-13) [mysensors.gateway_tcp] Received 0;255;3;0;2;2.1.1
arduino serial monitor:
0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1 3 TSM:INIT 4 TSF:WUR:MS=0 11 TSM:INIT:TSP OK 13 TSF:SID:OK,ID=2 14 TSM:FPAR 51 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 888 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0 893 TSF:MSG:FPAR OK,ID=0,D=1 2058 TSM:FPAR:OK 2059 TSM:ID 2060 TSM:ID:OK 2062 TSM:UPL 2065 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2071 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2076 TSF:MSG:PONG RECV,HP=1 2078 TSM:UPL:OK 2080 TSM:READY:ID=2,PAR=0,DIS=1 2084 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 2092 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2099 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1 2107 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 2134 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M 2141 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=4,pt=0,l=0,sg=0,ft=0,st=OK: 2148 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:DimmableLED 2157 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1 2163 MCO:REG:REQ 2167 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 2178 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1 2183 MCO:PIM:NODE REG=1 2185 MCO:BGN:STP 2188 TSF:MSG:SEND,2-2-0-0,s=0,c=2,t=3,pt=0,l=0,sg=0,ft=0,st=OK: 2194 MCO:BGN:INIT OK,TSP=1
Can anyone point me in the right direction as to why this doesn't work it would be much appreciated.
Cheers
H -
RE: Problem with dallastemperature sensor, node id.
Wow, this was a lot of information at once
I'm going to go through the code tomorrow and actually figure out whats going on. I'm contemplating actually writing my own code, instead of relying on someone else's. Might make things easier (or harder ) but in the end i think i might benefit from it.
i changed the code i had with the changes you suggested, and i can see the messages coming through to the gateway, but i still can't actually get home-assistant to display them. Trying to figure out if it's the code on the sensor, the code on the gateway or somewhere in-between that the message gets lost.
i really appreciate all your help, i'll get back as soon as i've revised my code and (knock on wood) got it to work
Again, thanks for all the help!
-
RE: Problem with dallastemperature sensor, node id.
Hi,
I read the guide, the only thing i couldn't figure out was the "manual node id, or AUTO". Im not entirely sure how to define this. I used the mysensors-library standard dallastemperature-sketch
Sketch:
#include <SPI.h> #include <DallasTemperature.h> #include <OneWire.h> #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected #define MAX_ATTACHED_DS18B20 16 unsigned long SLEEP_TIME = 10000; // Sleep time between reads (in milliseconds) OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. MySensor gw; float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; boolean receivedConfig = false; boolean metric = true; // Initialize temperature message MyMessage msg(0,V_TEMP); void setup() { // Startup up the OneWire library sensors.begin(); // requestTemperatures() will not block current thread sensors.setWaitForConversion(false); // Startup and initialize MySensors library. Set callback for incoming messages. gw.begin(); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Temperature Sensor", "1.1"); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { gw.present(i, S_TEMP); } } void loop() { // Process incoming messages (like config from server) gw.process(); // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // query conversion time and sleep until conversion completed int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution()); // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater) gw.sleep(conversionTime); // Read temperatures and send them to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error #if COMPARE_TEMP == 1 if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) { #else if (temperature != -127.00 && temperature != 85.00) { #endif // Send in the new temperature gw.send(msg.setSensor(i).set(temperature,1)); // Save new temperatures for next compare lastTemperature[i]=temperature; } } gw.sleep(SLEEP_TIME); }
What i managed to miss was a warning in the home-assistant.log
16-02-01 19:40:03 mysensors.mysensors: Error decoding message from gateway, probably received bad byte.
Not sure what that means exactly.
At startup it shows:Feb 02 19:34:48 raspberrypi hass[31732]: INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123 Feb 02 19:34:48 raspberrypi hass[31732]: INFO:mysensors.mysensors:Trying to connect to /dev/ttyUSB0 Feb 02 19:34:48 raspberrypi hass[31732]: INFO:homeassistant.core:Timer:starting Feb 02 19:34:48 raspberrypi hass[31732]: INFO:homeassistant.components.mysensors:update persistence: node 1 Feb 02 19:34:48 raspberrypi hass[31732]: INFO:netdisco.service:Scanning Feb 02 19:34:50 raspberrypi hass[31732]: INFO:homeassistant.components.media_player:Updating media_player entities Feb 02 19:34:50 raspberrypi hass[31732]: INFO:plexapi:GET http://10.0.1.11:32400/clients Feb 02 19:34:50 raspberrypi hass[31732]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 10.0.1.11 Feb 02 19:34:50 raspberrypi hass[31732]: INFO:plexapi:GET http://10.0.1.11:32400/status/sessions Feb 02 19:34:50 raspberrypi hass[31732]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 10.0.1.11 Feb 02 19:34:51 raspberrypi hass[31732]: INFO:mysensors.mysensors:/dev/ttyUSB0 is open... Feb 02 19:34:51 raspberrypi hass[31732]: INFO:mysensors.mysensors:Connected to /dev/ttyUSB0 Feb 02 19:34:51 raspberrypi hass[31732]: INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0 Feb 02 19:35:00 raspberrypi hass[31732]: INFO:homeassistant.components.sensor:Updating sensor entities
-
Problem with dallastemperature sensor, node id.
So I'm having some issues with a newly built dallastemperature sensor. I'm using an arduino Nano, nrf24l01+ and 2 ds18b20. Used the latest library, with Arduino IDE 1.6.6 on Mac OSx.
Other side is a raspberry pi with a standard serial gateway (arduino nano, nrf24l01+ high power). Im running home-assistant on the raspberry. Home-assistant can see the serial gateway and it starts up as it should, the sensor-node however doesn't seem to report as it should.
The mysensor.json file that home-assistant creates just contain:
{"1": {"sketch_name": "Temperature Sensor", "type": 17, "children": {}, "sketch_version": "1.1", "battery_level": 0, "sensor_id": 1}}
And the log output of home-assistant/serial-gateway is:
Feb 02 18:23:41 raspberrypi hass[420]: INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3 Feb 02 18:23:41 raspberrypi hass[420]: INFO:homeassistant.components.mysensors:update sensor_update: node 1 Feb 02 18:23:42 raspberrypi hass[420]: INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0 Feb 02 18:23:42 raspberrypi hass[420]: INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:send: 0-0-1-1 s=255,c=3,t=6,pt=0,l=1,sg=0,st=ok:M Feb 02 18:23:43 raspberrypi hass[420]: INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=11,pt=0,l=18,sg=0:Temperature Senso Feb 02 18:23:43 raspberrypi hass[420]: INFO:homeassistant.components.mysensors:update sensor_update: node 1 Feb 02 18:23:43 raspberrypi hass[420]: INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.1 Feb 02 18:23:43 raspberrypi hass[420]: INFO:homeassistant.components.mysensors:update sensor_update: node 1
I'm hoping that someone can point me in the right direction on this. It is for whatever reason not showing up in home-assistant at all. And I'm unsure if i've made a mistake somewhere.
If this is posted in the wrong category I'm sorry.
Cheers
Henrik -
RE: [SOLVED] Radio init failed
I had the same issue, tripplechecked my wiring and still had the issue. Added a decoupling capacitor between gcc and power and voilรก it worked. So i would suggest starting with a capacitor, i use 10uf but others use 4.7uf with same effect.