-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Handle Bluetooth connection dropping #71
Comments
I've got a mostly ok fix on a branch - it doesn't do any checking while in a menu/submenu, but once you're in a function it'll kick you out if the connection drops and send you back to the master menu It'd be nice to get it working in the submenu, and even attempting a reconnect on drop (side note: I'm back. Had a rental inspection to deal with and work kicked up a bit at the same time. All done for now thankfully) |
Ok, so it's not too hard to detect when the connection drops with an event, then have that event function handle the reconnect. The only headache is that if the connection drops while you're in a menu, then it doesn't return correctly once the reconnect is done (something to do with the progress bar). Annoyingly M5ez hasn't been updated in ~4 years, so I'm guessing that's a dead project |
Welcome back. I wondered how long before someone got annoyed enough to fix this. At the time I implemented the |
Yes, M5ez seems dead. The version we use is super hacked up to work on the M5StickC, but I recently reformatted it and will continue to use it (because it's EZ). The event system does work, I use it to update GPS data in the background. |
I'll be interested to see what you got, because anything above what is there (nothing) is an improvement. |
I recall struggling with the reconnection experience. Not sure, just firing random thoughts. |
Current behaviour of my test is to make a single reconnection attempt, then bail out if that fails (so you're back at the main menu in theory). In practice, all the menus are broken after the reconnect attempt, but if you're in the remote shutter or interval modes it works fine(ish) |
OK, that sounds like a good improvement. You may need it if you're finding crazy crashy stuff happening. |
OK, so it's definitely something to do with the progress bar - I removed that part of the code and it jumps back and forth between the reconnect and submenus just fine. It'd be really good to figure out what it's doing that's making the menu break, so I'm going to go digging and see what I can find It does have an issue dropping back to the main menu if connection totally fails, and I don't have a solution for that. Part of my brain is starting to tell me to just build my own damn menu system, but I'm pretty sure that's a terrible idea |
Yes, it's a terrible idea, but not one I haven't considered many times myself. Looking around LVGL seems to provide a lot of the basic things we require: There's some mention of the UIFlow stuff M5Stack offer being based on this library. |
I never looked at M5Stack's own UIFlow until now, maybe something to consider: |
Erg, OK, not UIFlow, it's a full-blown IDE in a browser thing. |
Yeah, I had a bit of a look at UIFlow, but since it's Python instead of C++ I figured I'd skip it. My C might be rusty, but it's a damn sight better than my non-existent python skills I'll see how much damage I can do between whatever I can remember from my uni days combined with everything I've learnt so far. Probably going to be a beautiful mess, I'll let you know how I get on |
I suggest trying to get the reconnect working with M5ez if at all possible, if you raise a PR I can help look into any weird stuff. Separately, we should raise an issue to investigate UI framework alternatives.
I'm aiming to get furble v2.0 released "soon-ish" hopefully with:
I'd defer the UI revamp to after v2, eg. v3. |
OK, so it looks like it's something to do with clearing the canvas/screen. Working on bypassing this step without breaking things EDIT: Commenting out the following 4 lines keeps the menu working fine. Looks like rubbish, but that's probably fixable
|
Well, that was an afternoon Turns out the major issue was the clear command sent to the buttons when the progress bar was created. Once that was discovered, actually relatively easy to get the behaviour back as expected Changes are on my fork, have a look and let me know what I've stuffed up. Tested it on my camera and it works fairly well |
Cool, will do tonight or tomorrow. |
@matthudsonau Can you raise a PR for your branch? If you raise a PR and allow reviewers push/write access I can modify M5ez itself to let us do it cleaner. |
I hope I've done that right. Between the M5 and Github, it's been a hell of a learning curve |
Looks good, I can push to your branch directly now. |
At the moment there is no monitoring of the connection status by the remote, so often the only indication that the connection has failed is that the camera stops responding
The text was updated successfully, but these errors were encountered: