Need help with Python issue on RPI local server/client

Hi Pete,

I have a somewhat similar setup and question. I have an RPi Zero W set up as a hotspot (not connected to the internet) running my Blynk local server. Using my iphone, when connected to the wifi hotspot I can control the Blynk app. However, if I try to use mobile/cellular data by updating my wifi configuration settings (remove router IP), I lose connectivity to the local server. Is there any way to connect to the Blynk server on the wifi hotspot while using cellular data?
My intention is to use the RPi / Blynk in my car so a central wifi router is not possible.
Thanks

Obviously you will lose connectivity if your server has no internet access and you are trying to connect via the internet.

You either have to get your server connected via a GSM router, or leave your server at home snd have a GSM connected device in your car.

Pete.

I’m not trying to connect to it via the internet. I’m still connected to my hotspot through wifi while the cellphone’s data is routed through GSM (see https://jrklein.com/2019/04/06/using-mobile-internet-data-while-connected-to-a-wifi-network-ios-android/). My question is if there’s any way to route the Blynk packets through wifi and not through cellular data.

I’m clearly missing part of the picture here. This statement…

Seems to be saying that you are telling your mobile phone to not connect via the server’s hotspot, but via GSM (internet) data instead.

Maybe more I formation/clarity is required.

Pete.

Just for clarification: My goal is have an rPi in my car running the Blynk server with a hotspot, and to be connected via wifi to the rPi, but have all cellular data routed through GSM. Please disregard the statement about removing the router IP. I am able to achieve connecting to both by using Apple Wifi Assist, and turning off cellular data for Blynk. This routes Blynk data to Wifi, even if cellular data is prioritized. I am able to ssh into the rPi, as well as ping my phone from the rPi. Now comes the next issue. When I run my Blynk python script on the rPi, I get this error:
Traceback (most recent call last):

File “automoc.py”, line 147, in

blynk.run()

File “/usr/local/lib/python2.7/dist-packages/BlynkLib.py”, line 252, in run

self.process(data)

File “/usr/local/lib/python2.7/dist-packages/BlynkLib.py”, line 213, in process

self.emit("int_"+args[1], args[2:])

IndexError: list index out of range

This does not happen when my phone prioritizes wifi data over cellular. Any ideas?

I appreciate the help

Okay, I’ve moved this to its own topic, as it’s now diverged significantly from the original topic.

I know nothing about Python, as I use either C++ or Node-Red for my projects and never use my RPI as a client.

Maybe someone else can help, but I guess the first thing they’ll ask is what version of the Python Blynk library you are using.

Pete.

Bumping this post, has anyone with Python expertise seen this issue? I am constantly getting kicked out of my python script with the following error:

blynk.run()

File “/usr/local/lib/python2.7/dist-packages/BlynkLib.py”, line 252, in run

self.process(data)

File “/usr/local/lib/python2.7/dist-packages/BlynkLib.py”, line 213, in process

I am running Blynk python v0.2.6.
Thanks

You can comment out these lines to solve the problem
(/home/pi/.local/lib/python3.7/site-packages/BlynkLib.py)
line 213

#elif cmd == MSG_INTERNAL:
#self.emit(“int_”+args[1], args[2:])
else:
print("Unexpected command: ", cmd)
#return self.disconnect()