Comments (25)
![drawing](https://private-user-images.githubusercontent.com/1498142/237241888-a6b1f108-5688-4d4f-9bc3-f441cb6a18c2.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzMjQ1NjIsIm5iZiI6MTcyMjMyNDI2MiwicGF0aCI6Ii8xNDk4MTQyLzIzNzI0MTg4OC1hNmIxZjEwOC01Njg4LTRkNGYtOWJjMy1mNDQxY2I2YTE4YzIuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzBUMDcyNDIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODA3YzhmNjY4N2FiMWQyN2Y5MDA3MjBlMDE2NDA3OTlhZTRhYjM3MzQ4MzkwYWQ2YjhlMGVlYTgxMjhkNTY2NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7mjn-b6b1gktrZ0V1nWJVyIzLDBfK4CBwBhUKQHqUA0)
from arduinobleota.
Not sure, but NimBle by default serve only one connected device at the same time. And if someone (some phone) is connected than no advertising at all. Try disconnect from all devices, maybe reboot device and try again. Remember that phone can try to reconnect automatically
from arduinobleota.
yes. once connected. cannot be seen by others.
I was just showing you the service description, which is good. and I can use the read only chars just fine.
so my server is advertising and the service is good
so must be Linux BLE scanner...
the screenshot is from an Android
from arduinobleota.
Try to scan bluetooth devices from your OS directly instead uploader.py
from arduinobleota.
i see the same problem on bluetoothctl..
maybe..
my app is connected, status=1
I write a characteristic value
set a future time for switch to upload service
(can't switch while IN the characteristic write callback)
after time switch to upload service
BLEDevice::stopAdvertising();
Sprintln("stopping scanner");
pBLEScanner->stop();
Sprintln("stopping service");
activeService[status]->stop();
Sprintln("deleting service");
delete activeService[status];
Sprintln("deleting server");
delete pServer;
// remove reference
pServer = NULL;
// create a new server object
pServer = BLEDevice::createServer();
Sprintln("ble server");
pServer->setCallbacks(new MyServerCallbacks());
BLEService *OTAService = ArduinoBleOTA.begin(pServer, InternalStorage,
HW_NAME.c_str(), HW_VER, SW_NAME.c_str(), SW_VER);
activeService[status] = OTAService;
Sprintln("restart advertising after resetup");
pAdvertising->addServiceUUID(OTAService->getUUID());
pAdvertising->start();
the app did NOT disconnect til eons later
the ESP code did NOT get a disconnect notice
but the server was destroyed and recreated
from arduinobleota.
I used bleak to scan
and while the android scanner app sees your service and characteristics, the bleak scanner sees , the prior UUID service
c8:f0:9e:75:1a:26
C8:F0:9E:75:1A:26
{'path': '/org/bluez/hci0/dev_C8_F0_9E_75_1A_26', 'props': {'Address': 'C8:F0:9E:75:1A:26', 'AddressType': 'public', 'Name': 'c8:f0:9e:75:1a:26', 'Alias': 'c8:f0:9e:75:1a:26', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -47, 'Connected': False, 'UUIDs': ['11050001-27b9-42f0-82aa-2e951747bbf9'], 'Adapter': '/org/bluez/hci0', 'TxPower': 9, 'ServicesResolved': False}}
{'uuids': ['11050001-27b9-42f0-82aa-2e951747bbf9'], 'manufacturer_data': {}}
-46
ConfigApp
the app
import asyncio
from bleak import BleakScanner
async def main():
devices = await BleakScanner.discover()
for device in devices:
print(device.name)
print(device.address)
print(device.details)
print(device.metadata)
print(device.rssi)
asyncio.run(main())
from arduinobleota.
Can you show advertising data (not visible services after connect) in android nRF Connect application?
from arduinobleota.
from arduinobleota.
![drawing](https://private-user-images.githubusercontent.com/1498142/237545515-60b2d89a-bd74-4ce8-87f6-ec3e4c5e47e5.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzMjQ1NjIsIm5iZiI6MTcyMjMyNDI2MiwicGF0aCI6Ii8xNDk4MTQyLzIzNzU0NTUxNS02MGIyZDg5YS1iZDc0LTRjZTgtODdmNi1lYzNlNGM1ZTQ3ZTUuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzBUMDcyNDIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Njg1OTAyNzIyYjExYjg0M2Q5Mzg3YjAxZmI4MzczMmNmYmU5YmQ3ZDA4YjMzY2U1M2MwOGI3NWY1MzlmZThhZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.xl666uo30f8iJCwN24SrUG1PSaRyK7uWHOth3LOK7qQ)
but connect and you see something different
from arduinobleota.
In BLE is difference what services device have and what services device advertise.
Device can have unlimited number of services.
But advertising block is limited and you should chose what to advertise:
#10 (comment)
If device doesn't advertise ota service than script will not find him.
You can remove this filter if you want:
ArduinoBleOTA/tools/uploader.py
Line 76 in 2e2a685
from arduinobleota.
thx, i thought I handled that on the change. I don't see explicit remove (using BLE, see it in Nimble path)
am away til monday
from arduinobleota.
actually, that distinction might make this whole thing easier. setup the three services, and just decide which one to advertise. my app discover handler just needs to know the found advertised service's characteristics to use.(which it currently 'assumes').
from arduinobleota.
But remember that it's not safety from security reason. Someone can connect and see that OTA services are available and flash other software.
You can additionally disable uploads and enable only when needed:
https://github.com/vovagorodok/ArduinoBleOTA/blob/main/doc/SECURITY.md#disable-uploads
from arduinobleota.
would only be available when my app says upload. not all the time.
then the box reboots and the service goes away til next time it's needed
I would probably change the UUIDs too
from arduinobleota.
so I couldn't wait til Sunday and had some time. bought another esp32, and redid the code.
works as you said. what's advertised vs services
from arduinobleota.
successful connect and upload!!!
non-nimble!
from arduinobleota.
only 764b/s, 24 min 17 sec for 1113712 bytes
doesn't reboot?
I have to do that?
from arduinobleota.
so I think I should close this as it was my fault, and fixed. and move to another topic about the finish up. apply/reboot...
from arduinobleota.
so I think I should close this as it was my fault, and fixed. and move to another topic about the finish up. apply/reboot...
Perhaps you forgot ArduinoBleOTA.pull();
in loop()
ArduinoBleOTA.pull()
is created in order to perform reboot only when nothing in loop and not incidentally reboot when esp32 do something
from arduinobleota.
well, now my system has cached (across boots) the device uuids and the upload service is not visible.
I redid the startup to only have ONE service, and the scan data still has both.
from arduinobleota.
ok, figured out how to clear the cache, now get an upload failure using NimBLE
connected -- my app
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)
on disconnect start advertising= 15c155ca-36c5-11ed-adc0-9741d6a72f04 -- my app
disconnected -- my app
from arduinobleota.
using non-nimble ESP32 BLE.
Installing. Upload time: 0:05:07.499808
Success!
(base) sam@sams:~/ArduinoBleOTA/tools$ rexx rexxtry say "1138176/((5*60)+07)"
3707.41368
from arduinobleota.
to clear cache
stop bluetooth service
delete the cache files (on linux/var/lib/bluetooth) under local device entry/folder)
restart bluetooth service
then can scan
have to do this all the time.
will provide the script (bash) code for this.. (need to test on mac)
from arduinobleota.
got nimble working,
Uploaded: 1139200/1139200
Installing. Upload time: 0:01:23.745954
"(1139200/(1*60+23))"
13725/bytes sec
the Nimble author said not to server->addService()
from arduinobleota.
I think I can close this now
from arduinobleota.
Related Issues (20)
- uploader.py/sh info HOT 13
- Help w platformio build problem w OTA HOT 15
- Create uploader.py based on bleak HOT 1
- Precised MTU/ATTR sizes HOT 5
- Remove advertising functionality from begin methods HOT 4
- dbus Module not found while using `uploader.py` HOT 3
- need help HOT 2
- send begin, write is not permitted error HOT 2
- enable/disable upload feature understanding HOT 2
- upload App says is wrote data, device counts don't match HOT 2
- which crc lib? HOT 5
- Support STM32 HOT 1
- Add script for automatic examples bin generation
- Security pin HOT 11
- Make as Arduino IDE library HOT 2
- Library ArduinoBleOTA on Arduino Nano 33 BLE with MBED HOT 1
- Example of combining this with lets say a BLE Serial application HOT 2
- Consider to use DIS service
- **Attention!** Add manufacture characteristic and regenerate uuids
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinobleota.