-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stability improvements #1
Comments
Reposting this here as I think it better fits this repo than the other one: Has anyone identified the chip on the physical device? I have the M300 Bluetooth version and the chip has a similar pinout to an ESP8266, but I'm not good enough at reverse engineering to be sure. The top of the chip is etched away just enough to make it impossible to make out the original number; at the right angles you can make out some lines, but not enough to form full letters. |
I don't believe someone here was tearing device down |
There is a sub-board I was too lazy to get to that all the connectors go to (except bottom right, which goes to the DC motor) but that board seems to just connect the batteries and provide some pre-regulation for the mainboard. The little unpopulated header seems to connect to power and three other pins, probably RX/TX/GPIO0 like most Tuya products. Haven't hooked up anything to it yet, might finally be my excuse to get a logic analyzer... Completely slipped my mind that the ESP8266 doesn't have Bluetooth, I've been working with the ESP32 too much lately. This has an 8x8 layout where as the ESP32 has a 16x16, so no chance of it being an ESP. |
@rospogrigio today I had spare time to dig into ESP32 BLE stack. However, now I'm stuck with sending data to lock - for some reason, it does stuck, when ESP32 tries to initiate BLE client for connection to characteristic. |
@rospogrigio I'm getting this error: It happens on connection, and what's the worse, is that after that ESP becomes unresponsive, I cannot even reconnect with serial monitor. Didn't find any reliable information on this yet. |
Sorry but I really don't have any expertise on this, wish I could help... |
So what I have now:
Here I stuck. It says "true", basically reports success from write operation. But lock doesn't respond to commands. Either data format is incorrect (I'm sending from *ptr, so it might be the problem, or maybe I have to convert that from string before sending, don't know), or write operation lies to me (unlikely, 'cause characteristic value seems to be changing). Next steps (after getting it working, of course):
To the last point: gateway is REALLY powerful and stable. It reboots itself in the matter of seconds in case of failure, and can connect to lock (almost) without failures from like 7-8 meters and 1 wall. That's what I was expecting. |
Yes, I believe, writing string itself was strange solution :) Will try to convert it back to bytes (I believe, there's 20 bytes in each of two commands), and send that. Also, I have some doubts on current integration status determining logic. |
I can help you with this: the FFF3 characteristic (you can read it, right? or at least you can use nRF Connect for this) has some status bytes (byte 5, in detail) that provide a error code in case of failure. This is how I understood that I was sending the wrong payloads, too.
Hope this might help, bye... |
This is REALLY impressive!! Can't wait to see it in action!! 😮 |
I MADE IT! Opening/closing works. Status update is not so well yet, there's gap to fill.
So what i want you to think:
Meanwhile, i will focus on initial gateway configuration. |
New updates: |
Cool, congratulations! So, my few first thoughts after reading this:
|
Oops, I just read your last message... Great!! |
I guess it's about the time. Let me create PR for your integration, and repo for gateway. |
Cool! Regarding whether to get the values from advert or FFF3, I seem to remember that nourmehdi wrote that FFF3 was more power consuming, so we'd probably better use the advert since you found a way to interrupt it on command. |
Here's PR: #7 |
And here https://github.com/formatBCE/Airbnk-MQTTOpenGateway is the repository. |
Super super cool! Tomorrow I'll try to find some time to play with it. |
Yes, i'm thinking on making WiFi access point with simple web page for initial setup, and when submitted, it will save prefs, reboot and connect to actual WiFi. |
@rospogrigio Flash it, it will start access point AirbnkOpenGateway. Fill-in the data there. It will create configuration, and reboot ESP32 to connect to your WiFi. Check it out, and tell me what's there. If you screw up with config, and it won't connect - after some attempts it will reset config and re-deploy AP. Cheers. |
Ok, I guess tomorrow I will change behavior a bit. |
Did it, now it will erase prefs only on wifi disconnect. |
Ok I have some ideas for the code merging, I'll take care of that so you can concentrate in improving the firmware if you believe there's more work to do there. Good job! 👍 |
@formatBCE how do I flash the firmware? Can I use Tasmota interface, as far as you know? |
OK, flashed, configured and launched HA but all entities are unavailable and I see nothing happening... I might have broken something, how can I debug the communication?? |
Hi! Nope, it's not normal. For me it works all the time - yesterday i tried like 50 times opening and closing, and got no errors. I just woke, and realized that my ESP disconnected from WiFi 1 hour ago. I think i will make some remote logging to trace the problem. WiFi/Mqtt part for this project i took from another sketch, so maybe worth optimizing. Thank you for merge, gonna try that today. |
Ok I did some tests and I confirm it works like 100% of the times, and from a bigger distance (like 3-4m, inside a wooden cabinet). With Tasmota I was having 50% of failures from 1m in open air... Awesome job!!! |
Thank you for kind words :) Yes it's doable (both multiple locks and sending parameters over mqtt). Downside to having multiple locks will be following:
|
I think you are still downloading the code from the master branch, but actually you need to download it from here: https://github.com/rospogrigio/airbnk_mqtt/tree/introducing_reload_service (Code -> Download ZIP) Regarding the open direction, I don't understand what you wrote. Can you explain better? In detail?
|
Hi, For me service restart work. I make a buton in lovelace and use to restart |
OK looks like we do need an option to force to reverse the status. @Corinake but does at least the operation follow what happens on the app? I mean, opening and closing as what happens in the app, and the possibility to reverse it? I need to understand if we also need an option to reverse the open/close command or only the lock status. |
Only for reversed status. The commands in HA are good if the text and icon are changed. |
Hi Rospogrigio can u add this in next ver (reverse mode for status) now configure it manually like Corinake wrote before . thx |
You can share please your button code? And give some explanation for what it's use? I have same problem |
@antonbek89 it's just button to call service airbnk-mqtt/reload, I guess. |
show_name: true just press button to restart you can read all releases what change was made |
@formatBCE @rospogrigio |
Hey @giltabibian Do you use ESPHome version of gateway? Or completely custom firmware? If custom, I'd suggest to move to ESPHome version - it's more stable, and easier to debug, since you can see wireless logs from it. |
Hi @formatBCE |
Oh that's good. Then you may debug wirelessly - gateway does log all activity. Just try to open log console in ESPHome, switch lock back and forth several times, and see if it shows sending/receiving. ESPHome also does post all logs into dedicated MQTT topic, so you might want to check that topic too. |
@formatBCE thanks for the quick response :) [19:59:29][D][airbnk_mqtt:238]: Got command do you have an idea what can cause? |
Ok, it might happen, that gateway does lose connection to WiFi, while writing command to the lock. It happens because of ESP32 nature: WiFi and Bluetooth using same antenna. And while scanning does leave enough room for WiFi to keep connection - command sending requires Bluetooth connection to lock, which takes full radio time. In most cases, if lock is responsive, this won't hurt. But if there's more time needed to connect to lock, WiFi drops, and takes a while to reconnect after. In result, success message isn't transferred to HA integration, and it also comes as stucking in Operating mode. You might connect gateway via USB to notebook, while staying closer to lock, and read logs from connected gateway via serial connection. It won't help with connection, but at least will help to debug. In terms of what to do for fix:
|
@formatBCE thanks for the eleborated reply. I don't think its a poor quality but I'm willing to buy a new one if you can recommend on LAN based it would be great. Another note that might be valuable, I do see that that the automation sends the command to unlock, but the integration logbook doesn't note any command change for lock. I'll try to look at the lock while this issue happen. It happened once a day, I'm not sure what exactly trigger the issue. |
I have couple of these actually, and sometimes they give me problems, although they are not so bad. I myself have WiFi version, and sometimes it lags for sure - but since I moved to my PR for this integration, it is much more stable. This PR eliminates need in confirmation from gateway - so is a bit lighter on WiFi/BLE stack. What about LAN ESP, didn't work with them, but now thinking of buying one for tests. My gateway is actually on the NSPanel from SONOFF (which is mounted by the door), so I will stick with WiFi. But Ethernet should be tested. |
@formatBCE Also, appreciate I'd you can update about the LAN esp32 once you use it. |
I will prepare instructions (need to recall all changes I did)... |
Great thanks! |
Question to @rospogrigio :) |
Oooops, I just realized I have never merged this, and I have been using that PR for the last 4 months. |
I guess we wait. If that strategy works, we will eliminate major problem with interaction. |
@formatBCE what is the process to use the PR? |
@giltabibian in this case you just replace content of 1 file in your custom_components folder. Then flash ESP with latest gateway code, and reboot Home Assistant. |
Want to update One issue I found ( not sure if its belong to PR) when the lock open manual the lock status doesn't changed, integration keep the last status |
If you have same lock as @rospogrigio , it's lock trouble. Adv messages don't reflect manual operations... |
I have M531 |
Yes, I believe it's same model. Unfortunately, no solution at the time... |
Same here. I also use M531 and the manual operation not advertise. |
Let's use this post to discuss ways to improve the stability of the connection: use a different firmware, rebuild tasmota, etc.
The text was updated successfully, but these errors were encountered: