Local server connecting 2 iPhone and 2 bots - using iPhone accelerometers to steer the bots

Blynk Local Server on Raspberry Pi 4
2 iPhones with blynk App using iPhone Accelerometer
2 bots with ESP8266(wemos d1 mini)

I am attempting to use the Raspi 4 Local server as the go-between for 2 identical bots and 2 iPhones to control the bots. The steering of the bots utilizes the accelerometers in the iPhone to generate direction information for the bots.

When I have one bot and one iPhone connected to the blynk local server everything works fine. When I connected the second bot the bots respond slowly and in a ‘pulsating’ fashion.

I have changed the accelerometer ‘write interval’ on the APP from push to 1 second on both phones in all kinds of combinations. That doesn’t seem to have an effect.

I suspect that the 2 iphone accelerometers are overwhelming the raspi 4 with data.

Any ideas about fixes?

It seems that with both iPhones connected to the server - the accelerometer information from both phones is sent and accepted by one or both bots. In other words the accelerometer info is not partitioned by phone, by bot. To say it another way one bot will accept accelerometer info from both phones simultaneously - so the bot is getting accelerometer info from a phone that it is not connected to.

You would need two different versions of the app, one with an auth code that relates to bot 1, and one that relates to bot 2.


Thats what I have. The sketch on each bot has a unique auth code. The app has a unique interface for each bot that uses the specific auth code.
The Accelerometer output is the only widget data that does not appear to be encoded for a specific bot. The bot sketch and app exchange other data such as RSSI, motor speeds and switch colors that do not leak out of their channel - Only the accelerometer data.

So sounds like you have 2 separate projects each tied to its bot, but if this happens in the same Blynk account, which is opened on 2 phones, having both projects in run mode would make each bot receive accelerometer data from both phones.

Thanks Eugene.
That’s right, 2 separate project apps in the same Blynk account that connects to a Blynk local server. It is only the accelerometer data that does not remain unique when running in this setup. For example, the bots read the wifi RSSI and send that to the app as well as changing colors on the app when certain RSSI parameters are exceeded. That stays unique to the appropriate app. Why would the accelerometer data be the only thing that ‘Bleeds over’?

btw- I have upgraded the IOS devices to the latest software, and have upgraded the local server from server-0.41.11.jar to server-0.41.12.jar. The server is running Java 11.

I guess the answer is two separate accounts. Have you tried this?


Is it possible to have 2 (or more) separate accounts on a local server?

I don’t use local server, but don’t see why you can’t do the ‘create account’ from the app login screen - with the customer server details of course.


Excellent suggestion!
The Blynk local server permits the creation of separate accounts(who knew?) as you suggested.
Logging the iPhones into separate accounts on the local server appears to have SOLVED this problem.
This creates a few more moving parts to keep track of but it fixes the issue.
Thanks much!

1 Like