A-Emile / Lime_Gen3_IoT_Replacement

Custom IoT for Lime Gen 3 E-Scooter and info about serial communication
Apache License 2.0
40 stars 10 forks source link

feature request: BT OTA and stack change #2

Open Pikokosan opened 1 year ago

Pikokosan commented 1 year ago

Im looking at the code and it's size. you may wanna look into switch to nimble stack to reduce the program size. also im looking at https://learn.sparkfun.com/tutorials/esp32-ota-updates-over-ble-from-a-react-web-application/all to do firmware updates which would eliminate the need for starting the wifi and having to use that of OTA updating.

Im messing with the nimble stack tonight to see if i can convert it over.

Pikokosan commented 1 year ago

Got the code compiling with the Nimble stack. need to do further testing but the program size went from 55% to 30% and dynamic memory went from 12% to 11%

Pikokosan commented 1 year ago

I have put a draft pull request #3 . id recommend starting a new branch called nimble. i can the request the pull to that so it can be tested before going to the main.

A-Emile commented 1 year ago

Hey bro, thank you very much. Im not very good with github. I have just merged you pull request but it instantly went in the main branch. So i reverted it. Can you tell me, how to do it correctly? And again, thnak you very much!

Pikokosan commented 1 year ago

This will explain it better than I can. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository#creating-a-branch

Pikokosan commented 1 year ago

I'm about to start work on the ota over ble feature. I had tried the spark fun method but ran into connection issues when updating. It would hang and not recover in the web app so I'm looking into this https://github.com/vovagorodok/ArduinoBleOTA

It's even got a flutter app so that makes it easier to implement into the limer app.

A-Emile commented 1 year ago

I'm about to start work on the ota over ble feature. I had tried the spark fun method but ran into connection issues when updating. It would hang and not recover in the web app so I'm looking into this https://github.com/vovagorodok/ArduinoBleOTA

It's even got a flutter app so that makes it easier to implement into the limer app.

Thats really nice! I will try to get the github stuff working this evening..

Pikokosan commented 1 year ago

Designed a small test board and ordered.

Got the arduinoOtaBle library implemented. Haven't be able to test fully due the libraries app being broken.

Pikokosan commented 1 year ago

All done and bench tested. Dev pcb came in. Firmware seems to be sorta working. Test setup doesn't have the rear motor so the controller is flashing a error. I'm gonna have to find my old hard drive with my notes for the gen2.5 decoding.

I had figured out throttle position and brake position and error codes

A-Emile commented 1 year ago

Respect! Sounds really nice! I was very busy the past weeks so i still wasnt able to get the github stuff working. But i'll dig into it in the following days.. Can you show us some pics of the pcb you made? Are you going to open source it, so everyone can create it?

Pikokosan commented 1 year ago

It's really just a dev board right now. I for sure plan to keep this whole thing open source 20230508_213141 20230508_213200 20230508_213156

Pikokosan commented 1 year ago

20230508_230231

Pikokosan commented 1 year ago

It's alive and runs now. Gonna try to design a 3d printable case. This is still just a dev board. Touch sensor and the speaker aren't in this design and I got the silk screen wrong for the wiring. The good: The nimble branch I started now has working ble ota updating functioning.

The bad: It's not currently reading data from the controller so no battery info or speed. I can see the last packet in the debug charteristics and it does show the battery level.

Ota does require changing a build flag and using my fork to work nicely with the crc library. (Currently working with the original author of the ota library on getting my code pulled to the main branch.

Pikokosan commented 1 year ago

I'll also be trying this on my 2.5 scooter in the next week. 2.5 scooter have 1 connector instead of two are were much easier to mod.

aIecxs commented 1 year ago

take note the LM2596S max. input voltage is 35 volt, while the charger input is 42 volt. better go for LM2596HVS or MP4560 module. the connector is Hirose DF13EA-20.

RSF99 commented 1 year ago

Alecxs i see that you have knowledge about it please guys if you can help me i would really appreciate it, I'm really frustrated been trying my best but no success 🙏

aIecxs commented 1 year ago

github is the wrong place to ask. find me on scootertalk.

insestito36 commented 11 months ago

It's really just a dev board right now. I for sure plan to keep this whole thing open source 20230508_213141 20230508_213200 20230508_213156

Can you share the files for make my own ? Thanks a lot for your effort!