1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.54k stars 782 forks source link

tests v0.9beta #318

Closed 1technophile closed 5 years ago

1technophile commented 5 years ago

Non regression testing of v0.9beta:

Here is below the functions to test https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit?pli=1#gid=0

Take the code from the master branch

rt400 commented 5 years ago

error in compile 'subjectGTWSendKey' was not declared in this scope

1technophile commented 5 years ago

thanks, missing macro added

kegra commented 5 years ago

hi , i used ZgatewayBT and ZmqttDiscovery , trying to compile give me error ZmqttDiscovery:42: error: 'BME' was not declared in this scope BME, "tempc", getUniqueId("bme", "tempc"), ^ exit status 1 'BME' was not declared in this scope

after commenting //#define discBme280 in ZmqttDiscovery i got it compiled correctly.

Now on the operation side , i had already used v08 and was getting quite nice updates from my Miflora inside home assistant but in V9 i never get all the updates from all 4 sensors (tem ,moi, lux, fer), i have tried both json and simple topic per sensor . I let it run for few hours but i always was getting maximum two of them and never the other two. I was getting session data but don't know if this is usable and how. i was monitoring all subjects /home/# so this has nothing to do with my configuration inside home assistant.

1technophile commented 5 years ago

Thanks for the feedback, as mqtt discovery is only implemented for BME at this time I should add some macros to avoid the error you have seen.

Regarding BLE did you changed something in the config_BT.h between both versions?

kegra commented 5 years ago

i have exactly the same parameters inside the config_BT.h nothing changed i even tried different scan intervals 10, 20 , 30 seconds i have both Miflora and the BLE temp and humidity sensor, the funny thing is in v8 i don't get updates from the temp and humidity sensor but i get them perfect in the V9 but miflora does not work in v9 at least for me. Have you tried both as the same time is there any strange conflict ? (maybe stupid of me to say this ) but have seen crazy stuff happening all those years.

1technophile commented 5 years ago

Yes I tried mi flora and mi jia at the same time but from what you are saying I need to retry ;-)

kegra commented 5 years ago

do you have any recommendations i can try ? maybe now i am thinking the BLE gateway (xiaomi camera acting as ble gateway) causes a trouble ? (if i am hijaking with irrelevant stuff i can continue to another thread or to the openmqttgateway community page if you like)

1technophile commented 5 years ago

could you just let ON your mi floras and mi jias?

kegra commented 5 years ago

i will leave this today all night to check again. thank you for your support and for this great project !

1technophile commented 5 years ago

thanks :-)

kegra commented 5 years ago

quick update, everything seems to work normal now, after tweaking a bit , but most important i think the BLE gateway (xiaomi cam) was causing the trouble , will test further after turning on the BLE Gateway again. thank you.

kegra commented 5 years ago

V9 seems solid for

Mi jia temperature, battery and humidity sensor integration OK Xiaomi flora (flower care) integration with HM10 OK add MQTT publishing of service data from BLE devices OK Web portal for wifi and mqtt configuration (ESP8266) OK Don't go to AP mode if wifi is lost OK send BLE beacons mac adress and rssi to MQTT OK

jeanniquini commented 5 years ago

I do not know much about it, but would not it be better to pass the states to MQTT as an object instead of a string? I'm sorry if I'm talking bullshit.

jeanniquini commented 5 years ago

@1technophile about issue #241 I'm using RF + BLE + DHT modules with nodemcu. And randomly openmqttgateway restarts. I am using to track a mi band 3 but as I have a google home mini, it also appears in the scans. With RF + DHT, I did not have this problem.

jeanniquini commented 5 years ago

If comment #define subjectHomePresence Base_Topic "home_presence/" Gateway_Name I've got: 'subjectHomePresence' was not declared in this scope If comment #define ZgatewayBT_v6xx I've got: 'mactopic' was not declared in this scope

kegra commented 5 years ago

Today i am trying to use the home presence publishing , i get JSON formatted data under the topic home/home_presence/OpenMQTTGateway/ { "id": "", "rssi": -65, "distance": 1.987855 }

the issue is i don't get anything under the id so i do not see how can i identify different BLE devices from here ?

jeanniquini commented 5 years ago

@kegra I am using rssi posted on specific mac. e.g.: home / OpenMQTTGateway / BTtoMQTT / 'MAC ADRESS'

kegra commented 5 years ago

@jeanniquini i can do this also using the topic as you posted using /distance instead of rssi but the thing is that the id should be included in the json for home presence. i was using exactly what you propose in the V.0.8 but in V.0.9 distance and home presence is much better for this purpose.

jeanniquini commented 5 years ago

@kegra are you using RF + BLE together? OMG is randomly crashing here.

kegra commented 5 years ago

@jeanniquini unfortunately i don't , i only use BLE.

1technophile commented 5 years ago

@jeanniquini

If comment #define subjectHomePresence Base_Topic "home_presence/" Gateway_Name I've got: 'subjectHomePresence' was not declared in this scope If comment #define ZgatewayBT_v6xx I've got: 'mactopic' was not declared in this scope

Please note that I'm not going to integrate json for older version of HM10 firmware, the code will be removed in next version

@kegra

{ "id": "", "rssi": -65, "distance": 1.987855 }

Corrected on master, thanks you both for pointing this

jeanniquini commented 5 years ago

@1technophile All right. I have the newer firmware version. Just trying to figure out what's causing the OMG crash... I turned off the BLE and everything is normal. I want to disable the service data to see if the problem is there.

1technophile commented 5 years ago

You are having a watchdog wdt reset ?

jeanniquini commented 5 years ago

@1technophile I'm watching on LWT topic. I configured the node-red to send me a notification when it goes offline.

jeanniquini commented 5 years ago

The RF module stops working after some time and the DHT delays the sending of the data a few times.

1technophile commented 5 years ago

could you try the last version from master please?

jeanniquini commented 5 years ago

Okay! I'll test for a few hours and come back here.

Dilbert66 commented 5 years ago

I had to comment 'include "wifi.h" in user_config.h in order to compile when using esp8266 2.4.2 board config. Kept giving me an error about a missing write_p function.

1technophile commented 5 years ago

@dilbert66 you should have a wrong library version on your environment. Indeed the build is working well for all boards here : https://travis-ci.org/1technophile/OpenMQTTGateway

Dilbert66 commented 5 years ago

Yes you are correct. I see my issue. Thank you.

jeanniquini commented 5 years ago

@1technophile Keeps restarting. I did several tests (firmware < v601, > v601, with and without JSON, different reading times). And I realized that when the service data is too large, the message is split into two, doubling the time set in the settings. Would be possible for an option with firmware > v601 but discarding the service data?

home/OpenMQTTGateway/BTtoMQTT/CDEDE7B9F4D2 {"rssi":-46,"servicedata":"00924ae67998ee5a6bbb2287e312e759c702cdede7b9f4d2"} 4f4b2b444953413a95a5b62dea6403df0a09ffe0001640ca7ec6480d0a 4f4b2b444953413a95a5b62dea6403df1c03039ffe17169ffe00000000000000000000000000000000000000000d0a Creating BLE buffer

45s omg

jeanniquini commented 5 years ago

Confirmed. It's my Mi Band service data ... I've left it out of range and the OMG has been 13 hours without crash so far.

1technophile commented 5 years ago

Thanks for the info, I will add an option to don't publish service data

jeanniquini commented 5 years ago

@1technophile Keeps spliting the message into two. And crashing.

30s v9

1technophile commented 5 years ago

Hello,

So as to have a view of the remaining test for v0.9beta you can lean on this file: https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit?pli=1#gid=0 Mainly we are missing:

If you can help for these tests don't hesitate to go and give your feedback

1technophile commented 5 years ago

@jeanniquini do you see always the same string size when it crashs?

jeanniquini commented 5 years ago

@1technophile I did not check the logs until it crashed. I only noticed that after a few minutes after publishing these duplicate and similar messages it crashes. But I can do that. Did you see that the service data is not published but it appears in the serial log?

1technophile commented 5 years ago

Yes i deactivated the publishing only. If you think this is due to traces, you can deactivate traces by commenting the corresponding macro. https://github.com/1technophile/OpenMQTTGateway/blob/3d459e058277a88582f07148607c5f855041a268/User_config.h#L172

jeanniquini commented 5 years ago

I tested it now. Trace is not the problem.

1technophile commented 5 years ago

Ok thanks, could you say me in this case if there is a constant limited number of characters ?

jeanniquini commented 5 years ago

Always 252 characters in serial log + 64 characters published (same). When #define pubBLEServiceData true is uncommented.

Serial.txt Published.txt

1technophile commented 5 years ago

@jeanniquini I ve added a limit to the service data string size, could you test it to see if it still crash. https://github.com/1technophile/OpenMQTTGateway/blob/Servicedatalimit/ZgatewayBT.ino

jeanniquini commented 5 years ago

RF stopped working after some time. Now mqtt messages are not duplicate but take double or triple the time set. Few times at the correct time. Mostly: correct / double, correct / double ... In the serial, different sizes of string. It seems that when it is bigger, time is doubled. I set 60s to test. If I reset the nodemcu, RF returns to work correctly.

1technophile commented 5 years ago

Regarding stability , Does your board still crash ? And once rf stopped working, does Ble still work ?

jeanniquini commented 5 years ago

It was not crashing, only the rf stopped working. BLE Still working but not following the time set between the readings as I said before. Sometimes the message is still duplicated.

keschner commented 5 years ago

@1technophile I switched from 0.8.1 to 0.9beta because the BT data for Mi flora were not read correctly in 0.8. In 0.9 this works perfectly with my HM-11, but RF stops working. The RF command is published, but nothing is send. I've checked the configured RF emitter pin because it's changed in dev-branch to 4, but in master it's still 3 (ESP8266), so my hardware setup should work without changes (I've also tried with pin 4 :wink:). All lib's are updated and I didn't change anything in the RF config. If I switch back to 0.8.1 RF is working.

Do you have a hint what could cause this issue?

BTW: Thanks for sharing your great project 😄

1technophile commented 5 years ago

@keschner thanks for your feedback ! Could you point me what are you getting in the serial monitor when you are testing RF with 0.9beta ? Would it be possible to test the v0.9beta with the v0.8 rcswitch library included ? The library changed between both versions

keschner commented 5 years ago

@1technophile thanks for your fast response. To check the serial output I've changed the emitter pin to 4, so I can use the RX pin for the serial monitor.

With this changed setup I've checked the serial output and get the following error (74880 Baud not the configured 115200 :confused:): Fatal exception (28): epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000

With the unchanged rcswitch lib I don't get this error. But it doesn't work either. I only get Hey I got a callback in the serial monitor (at 115200 Baud).

1technophile commented 5 years ago

Hmm, I see, please go back to the v0.9beta full setup (with the v0.9beta rcswitch library)

Your issue should be that simplePublishing is deactivated by default with v0.9beta. And you are publishing your commands with simplePublishing. Try to uncomment it in user_config.h it should help you

keschner commented 5 years ago

:man_facepalming: ... haven't seen that. Thanks for your help. Now everything works as expected.