deploythefleet / arduino_ble_provisioning

A simple starter project that uses BLE for WiFi provisioning
3 stars 2 forks source link

BLE Provision With PlatformIO #2

Open Alaa-Aim opened 3 months ago

Alaa-Aim commented 3 months ago

@sidwarkd , Hi, this code can be modified to make it work on Arduino framework within PlatformIO ? if yes, could you please help on that ?, thanks in advance

sidwarkd commented 3 months ago

Yeah, shouldn't be too hard! Let me see if I can put together an example and get back to you. I'll post an update here.

Alaa-Aim commented 3 months ago

Yeah, shouldn't be too hard! Let me see if I can put together an example and get back to you. I'll post an update here.

Many thanks for your prompt response, and efforts in advanced

iammyur commented 3 months ago

Hello @Alaa-Aim , Nice to meet you, may be I can import my effort in your requirement and get the solution for that. If you don't mine.

Alaa-Aim commented 3 months ago

Hello @Alaa-Aim , Nice to meet you, may be I can import my effort in your requirement and get the solution for that. If you don't mine.

Hi @iammyur , Nice to meet you too, Hope you have a lovely day, that would be highly appreciated, as I'm only using Arduino framework on platformIO and I'm not into IDF, thanks in advanced.

iammyur commented 3 months ago

@Alaa-Aim Great!, I am also familiar with Arduino framework and platform IO. and I will come with proper solution.

iammyur commented 3 months ago

@Alaa-Aim Please check this https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFiProv/examples/WiFiProv/WiFiProv.ino

Alaa-Aim commented 3 months ago

@Alaa-Aim Please check this https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFiProv/examples/WiFiProv/WiFiProv.ino

thank you, it works but it takes a lot of space. "Note: This sketch takes up a lot of space for the app and may not be able to flash with default setting on some chips. If you see Error like this: "Sketch too big" In Arduino IDE go to: Tools > Partition scheme > chose anything that has more than 1.4MB APP"

iammyur commented 3 months ago

@Alaa-Aim Yes, that's true, I will try to make different code for that.

sidwarkd commented 2 months ago

@Alaa-Aim @iammyur Thanks so much for picking this issue up and running with it. I tried to do a simple port to get the code running in PlatformIO and hit a lot of walls. I attribute that to my inexperience with PlatformIO and some dependency issues I ran into. I haven't had a chance to revisit it yet but if you can come up with a solution I'd be happy to merge it in.

iammyur commented 3 weeks ago

@Alaa-Aim I just resolved this issue, which should free up around 50% of the memory on the ESP32 using PlatformIO.

Alaa-Aim commented 3 weeks ago

@Alaa-Aim I just resolved this issue, which should free up around 50% of the memory on the ESP32 using PlatformIO.

Could you please share the improved code

iammyur commented 3 weeks ago

sure, code will be same, I just changed the partitions scheme

sidwarkd commented 2 weeks ago

@iammyur is it something you want to share a PR for? Or even a link would be helpful for others that come across this.

iammyur commented 2 weeks ago

@sidwarkd and @Alaa-Aim I would like to attach CSV file for partitions scheme ble_prov_partitions.csv

sidwarkd commented 2 weeks ago

@iammyur I see the different layout but how does this introduce support for PlatformIO?

iammyur commented 2 weeks ago

@sidwarkd Why isn't PlatformIO supported? The code at this link provides BLE provisioning using the Arduino framework and works with both the Arduino IDE and PlatformIO. However, we encountered flash memory space issues due to an improper partition scheme. I have now fixed that issue with the specified partition scheme.

sidwarkd commented 2 weeks ago

@iammyur I see. The original ask on this issue was to support PlatformIO and when I tried it initially it didn't work for some reason that I couldn't figure out at the time. I guess I just need to try again in PlatformIO with this code to see if it works but to do that I need an ini file and that was where I got stuck last time.

iammyur commented 1 week ago

@sidwarkd Aww, Please don't forgot to mention partition file in platformio.ini like this and make sure your partition.csv file in your project folder, otherwise it will not work

; PlatformIO Project Configuration File ; ; Build options: build flags, source filter ; Upload options: custom upload port, speed and extra flags ; Library options: dependencies, extra library storages ; Advanced options: extra scripting ; ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html

[env:esp32-c3-devkitm-1] platform = espressif32 board = esp32-c3-devkitm-1 framework = arduino upload_speed=1152000 board_build.partitions=partition.csv

iammyur commented 6 days ago

@sidwarkd, @Alaa-Aim I hope you got the perfect solution for this problem.

Alaa-Aim commented 6 days ago

@sidwarkd, @Alaa-Aim I hope you got the perfect solution for this problem. @iammyur

Many thanks , works just fine for me, but not much memory change

'RAM: [== ] 17.2% (used 56428 bytes from 327680 bytes) Flash: [======== ] 79.6% (used 1564845 bytes from 1966080 bytes)'

iammyur commented 4 days ago

@sidwarkd, @Alaa-Aim I hope you got the perfect solution for this problem. @iammyur

Many thanks , works just fine for me, but not much memory change

'RAM: [== ] 17.2% (used 56428 bytes from 327680 bytes) Flash: [======== ] 79.6% (used 1564845 bytes from 1966080 bytes)'

Can you please tell me which MCU you are using? I have set up these things with ESP32-C3 WROOM.

Alaa-Aim commented 4 days ago

@sidwarkd, @Alaa-Aim I hope you got the perfect solution for this problem. @iammyur

Many thanks , works just fine for me, but not much memory change 'RAM: [== ] 17.2% (used 56428 bytes from 327680 bytes) Flash: [======== ] 79.6% (used 1564845 bytes from 1966080 bytes)'

Can you please tell me which MCU you are using? I have set up these things with ESP32-C3 WROOM.

@iammyur

I am using ESP32 Dev Board and ESP32S3 Dev Board