vovagorodok / ArduinoBleOTA

Upload firmware over Bluetooth
MIT License
19 stars 7 forks source link

Security pin #36

Closed faizannazir closed 5 months ago

faizannazir commented 6 months ago

what is security pin and how can we set our own i tried ota_pin as pin and tried setpin function to set both didnot worked for me

vovagorodok commented 6 months ago

Here is small doc about security: https://github.com/vovagorodok/ArduinoBleOTA/blob/main/doc/SECURITY.md

From doc You can see that there are two options to provide a security by disabling/enabling uploads (using button/switch for example) or set a pin code. See:

drawing
vovagorodok commented 6 months ago

Examples of secutity: Disable upload: https://github.com/vovagorodok/ArduinoBleOTA/blob/main/examples/security_disable_upload/security_disable_upload.ino Pin code: https://github.com/vovagorodok/ArduinoBleOTA/blob/main/examples/security_pin_code/security_pin_code.ino

faizannazir commented 6 months ago

when i try to connect ble device from app it asked for pin

vovagorodok commented 6 months ago

because You set pin code before

faizannazir commented 6 months ago

because You set pin code before

by security.setpin(12345) ???

without this code also it ask for pin and pin 12345 also not work

vovagorodok commented 6 months ago

As I remember Nim-Ble stack requires exact 6 digits pin. Try 123450 or 012345

Proposed to use ble_ota_app to change pin. It provides interface with 6 only digits pin code

vovagorodok commented 6 months ago

Renamed a bit from pin to pin code

faizannazir commented 6 months ago

how to run these examples on arduino ide is there any possibility to make them compatible with arduino ide

vovagorodok commented 6 months ago

I'm PlatformIO user, for me easier to just add to my project:

build_flags =
    -D USE_NIM_BLE_ARDUINO_LIB
lib_deps =
    https://github.com/vovagorodok/ArduinoBleOTA

I have plans to add this library to PlatformIO Hub and prepare it to work in Arduino IDE. But for this moment there is one small issue that should be solved with non NimBle part of this library. I hope this month I'll done all of that

vovagorodok commented 6 months ago

Created issue in order to remember about it: https://github.com/vovagorodok/ArduinoBleOTA/issues/37

vovagorodok commented 5 months ago

Library available at ArduinoIDE as vovagorodok_ArduinoBleOTA.\ And at PlatformIO as:

build_flags =
    -D USE_NIM_BLE_ARDUINO_LIB
lib_deps =
    vovagorodok/ArduinoBleOTA@^1.0.0