![]() |
crc error on custom http request - Printable Version +- vThings Forums (http://forum.vair-monitor.com) +-- Forum: vThings (http://forum.vair-monitor.com/forumdisplay.php?fid=1) +--- Forum: vAir Monitor (CO2, Dust, Tempereature, etc..) (http://forum.vair-monitor.com/forumdisplay.php?fid=2) +--- Thread: crc error on custom http request (/showthread.php?tid=50) |
crc error on custom http request - jant80 - 01-20-2017 I'm having trouble getting the sensor readings out for several sensors. I'm getting crc errors: [crc1Dcustom_url_clean custom_url_clean] [ready >] [crc20custom_url_add "0","#http://192.168.178.43:8080/json.htm?type=command¶m=udevice&idx=78&nval ERROR: Bad CRC. Got 0x70, expected: 0x20 ready >] The correct request is: #http://192.168.178.43:8080/json.htm?type=command¶m=udevice&idx=78&nvalue=0&svalue=%TEMP%;%HUM%;0 When I test it in a browser the values are accepted by Domoticz. But the problem is not just this url, some others that give me this error: "http://192.168.178.43:8080/json.htm?type=command¶m=udevice&idx=77&svalue=%LUX%" or #http://192.168.178.43:8080/json.htm?type=command¶m=udevice&idx=77&svalue=%LUX% give: [crc03custom_url_add "0","http://192.168.178.43:8080/json.htm?type=command¶m=udevice&idx=78&nvalu ERROR: Bad CRC. Got 0x26,] [expected: 0x3 It also happens for ThingsSpeak: "http://api.thingspeak.com/update?key=KEY123456&field1=%LUX%" [crc42custom_url_add "1","#http://api.thingspeak.com/update?key=HKJKJHKKJHKH&field1=%TEMP%&field2 ERROR: Bad CRC. Got 0xD, expected: 0x42 ready >] But it doesn't always happen... This one works: #http://api.thingspeak.com/update?key=KJHKHKHJKH&field1=%CO2% [crc6Dcustom_url_add "0","#http://api.thingspeak.com/update?key=HKJKJHKKJHKH&field1=%CO2%" custom_url_add "0","#http://api.thingspeak.com/update?key=HKJKJHKKJHKH&field1=%CO2%"] [ready >] [crc0Dprop_set "tsKey" "HKJKJHKKJHKH" prop_set "tsKey" "HKJKJHKKJHKH"] But when I add a second sensor: #http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=%CO2%&field2=%TEMP% [crc2Acustom_url_add "0","#http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=%CO2%&field2= ERROR: Bad CRC. Got 0x4, expected: 0x2A ready > sendNowCond] So what is going one here??? I have checked the url's for correctness and they insert values into ThinkSpeak and Domoticz, but apparently something goes wrong in the sensor... A piece of log of a working configuration for the co2 sensor: --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor] [BME280 BMP085] [PM2005 CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750] [APDS9960] [--- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10] [Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Decimal Separator is: .] [Raw CO2: 1095] [ready > Completed in: 7643ms Going into power-safe mode for 30 seconds] [8EpÈ 0,JYø0xCÉüø] [ ÁHeap at start: 37392 Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect I2C Bus on SDA:SCA (14:5) --- Setup PLUGINS --- Neopixel DweetIO WebServer WebSocketServer PowerManager GPIO Servo Annemometer TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor] [BME280 BMP085] [PM2005 CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750] [APDS9960 --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10 Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Decimal Separator is: .] [Raw CO2: 1102] [ready > Completed in: 7650ms Going into power-safe mode for 30 seconds] [ÈdOX¸<$RZøðCZÔÍ] [ ÁHeap at start: 37392 Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect I2C Bus on SDA:SCA (14:5) --- Setup PLUGINS --- Neopixel DweetIO WebServer WebSocketServer PowerManager GPIO Servo Annemometer TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor BME280 BMP085] [PM2005 CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750] [APDS9960 --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10] [Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 1 Found SI7021 - Temperature/Humidity Sensor] [Decimal Separator is: .] [Raw CO2: 1100] [CustomHTTPDest::process SerialDumpDest::process IP : 0.0.0.0 CHIPID : D544BE RUNTIME : 694 TEMP : 19.89 TEMPR : 19.89 HUM : 42 CO2 : 1092 CO2R : 1100 MQTTDest::process] [RFDest::process ready > Completed in: 7915ms Going into power-safe mode for 30 seconds] [DtIÙ0G,Àü4xBøü] [ ÁHeap at start: 37392] [Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort] [vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect] [meter] [crc1Dcustom_url_clean custom_url_clean ERROR: Command not recognized ready > TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor] [] [crc6Dcustom_url_add "0","#http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=%CO2%" custom_url_add "0","#http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=%CO2%" ERROR: Command not recognized ready > BMP085] [crc0Dprop_set "tsKey" "GTRYU0CEFJ07P86S" prop_set "tsKey" "GTRYU0CEFJ07P86S"] [ready > PM2005] [CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750] [APDS9960 --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10 Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Decimal Separator is: .] [Raw CO2: 1099 ready > ------State changed to: 3 IP address: 192.168.178.25 in 8120 ms GOT IP] [sendNowCond] [--- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Raw CO2: 1099] [ready >] [sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Raw CO2: 1097] [ready >] [crc71nop ready >] [crc1Dcustom_url_clean custom_url_clean] [ready >] [crc6Dcustom_url_add "0","#http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=%CO2%" custom_url_add "0","#http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=%CO2%"] [ready >] [crc0Dprop_set "tsKey" "GTRYU0CEFJ07P86S" prop_set "tsKey" "GTRYU0CEFJ07P86S"] [ready >] [sendNowCond] [--- DestHanlder: sendValue --- 1 Found SI7021 - Temperature/Humidity Sensor] [Raw CO2: 1097] [CustomHTTPDest::process Calling HTTP: [http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=1099]] [Response Code: 200 CLOSED Response Code: 200 SerialDumpDest::process IP : 192.168.178.25 CHIPID : D544BE RUNTIME : 831 TEMP : 20.10 TEMPR : 20.10 HUM : 41 CO2 : 1099 CO2R : 1097 MQTTDest::process] [RFDest::process ready >] [sendNowCond] [--- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Raw CO2: 1099] [ready >] [sendNowCond] [--- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Raw CO2: 1105] [ready >] [sendNowCond] [--- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor] [Raw CO2: 1099] [ready >] A bit of log that doesn't work... --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10] [Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 1 Found SI7021 - Temperature/Humidity Sensor Decimal Separator is: .] [Raw CO2: 1107] [CustomHTTPDest::process Calling HTTP: [http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=1105] Response Code: 200 CLOSED Response Code: 200 SerialDumpDest::process IP : 0.0.0.0 CHIPID : D544BE RUNTIME : 1243 TEMP : 20.42 TEMPR : 20.42 HUM : 40 CO2 : 1105 CO2R : 1107 MQTTDest::process RFDest::process ready > Completed in: 8475ms Going into power-safe mode for 30 seconds] [¶AÌièE¶LØ@x:Ùðú ÁHeap at start: 37392 Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect] [I2C Bus on SDA:SCA (14:5) --- Setup PLUGINS --- Neopixel DweetIO WebServer WebSocketServer PowerManager GPIO Servo Annemometer TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor BME280] [BMP085 PM2005 CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750 APDS9960 --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10 Blynk] [Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor Decimal Separator is: .] [Raw CO2: 1107] [ready > Completed in: 7772ms Going into power-safe mode for 30 seconds] [¶PÙ4@ðlØ _Iñø] [ ÁHeap at start: 37392] [Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort] [vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect] [I2C Bus on SDA:SCA (14:5) --- Setup PLUGINS --- Neopixel DweetIO WebServer WebSocketServer PowerManager GPIO Servo Annemometer TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor] [BME280] [BMP085] [PM2005] [CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750 APDS9960 --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10] [Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor Decimal Separator is: .] [Raw CO2: 1112] [ready > Completed in: 7755ms Going into power-safe mode for 30 seconds] [ÈdOY¸,ÒÒZøìh`¦þÿ] [ ÁHeap at start: 37392] [Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect I2C Bus on SDA:SCA (14:5) --- Setup PLUGINS --- Neopixel DweetIO WebServer WebSocketServer PowerManager GPIO Servo Annemometer TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor BME280] [BMP085 PM2005 CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750 APDS9960 --- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10] [Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 0 Found SI7021 - Temperature/Humidity Sensor Decimal Separator is: .] [Raw CO2: 1115] [ready > Completed in: 7761ms Going into power-safe mode for 30 seconds] [ÈDðI¤ÒXøìxB¦üü] [ ÁHeap at start: 37392] [Device will go to Deep Sleep mode, once data is sent. Press [Enter] to abort] [vESPrino v1.16 build20170103 IP address: 0.0.0.0 Chip ID: D544BE ready > Waiting for auto-connect] [I2C Bus on SDA:SCA (14:5) --- Setup PLUGINS --- Neopixel DweetIO WebServer WebSocketServer PowerManager GPIO Servo Annemometer TimerManager --- Setup SENSORS --- CO2 TEST SI7021 Found SI7021 - Temperature/Humidity Sensor] [BME280] [BMP085] [PM2005] [CDM7160 Found CDM7160 CO2 Sensor DS18B20 TSL2561] [BH1750] [APDS9960] [--- Setup DESTINATIONS --- CustomHTTP SerialDump MQTT RFX10] [Blynk Heap At setup end: 34416 ------State changed to: 6 sendNowCond --- DestHanlder: sendValue --- 1 Found SI7021 - Temperature/Humidity Sensor] [Decimal Separator is: .] [Raw CO2: 1119] [CustomHTTPDest::process Calling HTTP: [http://api.thingspeak.com/update?key=GTRYU0CEFJ07P86S&field1=1112]] [Response Code: 200 CLOSED Response Code: 200 SerialDumpDest::process IP : 0.0.0.0 CHIPID : D544BE RUNTIME : 1395 TEMP : 20.46 TEMPR : 20.46 HUM : 40 CO2 : 1112 CO2R : 1119 MQTTDest::process] [RFDest::process ready > Completed in: 8450ms Going into power-safe mode for 30 seconds] RE: crc error on custom http request - admin - 01-20-2017 hmmm, this is an internal protection of the "protocol" that i invented.. when the UI sends a command it adds also a checksum, so that the sensor can be sure that what it got is what was sent and in this case, for some reason the sensor does not get everything it may be some issue with the el capitan drivers.. i will check now in more detail if i can add some additional buffers when sending and receiving so there are sensors where those commands work, and some where they aren't.. or with some url's it works 0 with others it doesn't i am almost done with the testing of the WiFi only configuration version, i hope this weekend i will be done with it - then you can give it a try - then the whole configuration is wireless sadly now that MacOS sierra is out i do not know how to upgrade to ElCapitan and my mac does not support Sierra ![]() ![]() RE: crc error on custom http request - jant80 - 01-20-2017 Yeah, I'm on ElCapitan on a 2010 MacBook pro. Still works great. I think I could upgrade, but I need a good reason. I could use windows 7 of Rasbian to configure stuff. I was wondering whether a wifi config would be possible, cause it would be very convenient. Just let me know if you want me to test something. RE: crc error on custom http request - admin - 01-22-2017 then you could give it a try on windows 7. for rasbian i think it wouldn't work RE: crc error on custom http request - jant80 - 01-22-2017 Just tried win 7 (again). First time I had driver problems and I was able to get the sensor detected under MacOS easier so I use that. Because you said to try win 7 I tried again and now the sensor were recognised right away. The CRC errors don't appear on the chrome app under win 7. So I have been able to configure the LUX sensor, haven't tried the others yet but I assume it's OK as well. One comment on the LUX sensor: it doesn't seem to be supported by the interface. There are no lux fields under the ThingSpeak and Domoticz settings pages. For me it's OK to adapt the HTTP requests, I like that ability, but I can imagine that it could be confusing for others. For the domoticz settings I have to enter a user and password, because I needed to set these on my domoticz server. I can't enter these in the domoticz tab. Again: adapting the HTTP request to add the user:pw works fine for me, but is less user friendly. I hope you are doing well on the wifi config utility, looking forward to that one. But for now I'm fine and can configure what I need. RE: crc error on custom http request - admin - 01-22-2017 great ![]() and yeah i will add those fields in the next release so far it seems to be working well, so i guess i will release it soon ![]() RE: crc error on custom http request - admin - 01-23-2017 And btw, i would appreciate it if you could help me - what kind of device do you add for Light meter in domoticz, and what kind of url? so that i can hard code it there |