Great hack @khoih Just shows what a real programmer can do to make things work
@Crosswalkersam However, for both a “Within WiFi router range” and “Out on the field, but still in internet range of cell (else even Blynk BT wouldn’t work)” wouldn’t simply setting a hotspot on the Cell with same SSID (as at home) do the trick? That is how I get tablets and laptops that I normally use in home, to work without any changes when on the road.
Of course this depends on your cell supplier allowing tethering
Thanks for your request and original code which is now included in the new hack library.
Sometimes, unusual requests , like this, can create a real headache, but we all can learn from that by doing something different and strange (hacking), hopefully helpful for other users.
Your contribution (request / code) was used (hope you don't mind) and recognized in GitHub page.
Thanks to Crosswalkersam for the original code and request to inspire the work.
Sadly not. When I am outside, looking for radioactive rocks, I am often in the forest or in the mountains, where I either have E or no cellphone service at all. When I have the possibility to use a hotspot, I will do that.
Then Blynk’s BT will not work either… basically Blynk, as an IoT product, requires constant communication link to/from the Server (the App is primarily just the GUI, not the brains).
The BT link just used the phone to act as that Device ↔ BT ↔ WiFi/Cell ↔ SERVER ↔ WiFi/Cell ↔ App link.
So unless you are also packing a portable Local Server, as an AP for both the phone/App & devices to connect too, then you will NOT get what you want with either WiFi or BT devices when out of cell/WiFi range.
I guess @Crosswalkersam meant that the cellphone is close (to use BT) as well as the cell service must be available (to use Blynk).
I also guess the reason to use this way is as follows:
The SSID and PASS is hardcoded to the WiFi at home, (unless using WiFiMulti lib or similar feature to auto connect to available WiFi)
Not comfortable for every user to change Cell Hotspot SSID and PASS to the same as Home WiFi.
Use BT when outside in the field is the easiest way for normal user without changing anything in the code, Blynk APP
Certainly, using cell Hotspot is the better way, if possible.
I took this literally … but alas, Blynk needs some form of server connection at ALL times.
And based on many past posts… Blynk’s Bluetooth and BLE are NOT as reliable/consistent as WiFi, nor are they as fast, as they act as an additional relay to/from the Device - App - Server - App - Device
I suspect that uninitiated users expect Blynk’s BT/BLE to act like most other such Apps… as in a simple link between device and App, with NO other considerations required… which is just NOT the case with Blynk.
I already change the library so that you can run both BT and WiFi at the same time.
Can you test the code to see if it’s running OK with both (WiFi and BT) at the same time. Note
You must have 2 different Blynk projects and tokens, 1 for WiFi, one for BT.
Currently, Blynk.begin() is blocking function, so that when there is no WiFi/Blynk, the code can’t run further. If this is OK, we’ll change to use non-blocking calls Blynk.config() and Blynk.connect()
Blynk’s Bluetooth and BLE are NOT as reliable/consistent as WiFi, nor are they as fast, as they act as an additional relay to/from the Device - App - Server - App - Device
That’s why we, you and I personally, all try to avoid using BT/BLE whenever possible.
But we can’t know what the normal users would like and are comfortable to use.
I believe @Crosswalkersam has very good reason to use this BT/WiFi way as specified in Instructables so that nothing needs to be changed in the system at all, just press a SW.
I wanted an option to use WiFi for a stationary setup at home and Bluetooth to use the device out in the field
Yep… I (once) fought the losing battle(s) to educate those fans of the old tune… “Users just wanna use BT/BLE”… but I should quit the slaughter while I still have some blood left in me
I’ve never felt the need to stick needles on my eyes, or use Blynk Bluetooth/BLE, but my understanding was that Bluetooth could be used in phone to server mode without any internet/GPRS connectivity.
I recall some issues about not being able to start the app (not getting past the juggling balls screen), but that was fixed by adding a facility to connect without any internet connection.
As I said, I’ve never tried this myself, so could be totally wrong.
You don’t know what fun you are missing … “They’re coming to take me away ho ho hee hee ha haaa…”
Ya, I don’t recall those details… but since Account Login, Project Data and Device Authentication is supposedly stored/processed on the Server, I don’t see how that could have been overcome without total workover (which may be the case with Blynk 2.0ooomygoodnessitisneverhappening)
Honestly, I don’t care and shouldn’t have gotten involved in this topic as I never liked Blynk’s BT/BLE (it was not reliable enough for me) and I actually don’t actively use Blynk anymore either. Came for the Python interest, got stuck in the debating again… my bad
Update
Just tested and verified the double-dipping WiFi and BT/BLE can work simultaneously using the above sketch / lib mod. All the previously-working widgets are still working correctly.