Salatini
Posts: 3
Joined: Fri Feb 03, 2017 1:48 am

Create Ad hoc Network via Wifi or Bluetooth

Fri Feb 03, 2017 1:59 am

Hallo everyone :)
Iam trying to create a group of robots with RaspberryPi Controller. Those must be connected with each other to share the date between them. Now I am confused which one would be better to use ( Bluetooth Ad-hoc Network or Wifi )?
Unfortunately I didn't find any helpful way to create anyone of them.

I have set them up already connected them to my MacBook already and created a VNC-server with Bluetooth but without the ad-hoc.

I would appreciate your efforts if you get me a way to create an ad-hoc network with the python code to share the msgs between them

Thank you in advanced

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Create Ad hoc Network via Wifi or Bluetooth

Fri Feb 03, 2017 9:29 am

You say that you want to share the date between your robots. Just the date, or is that a typo?

Assuming a single Pi to act as a controller plus a number of robots, each of which may also be built around a PI:
Your controller Pi could act as a wifi access point which the robots connect to. The controller could also connect to an existing wifi network (probably using a second, USB wifi dongle) if required.

For passing messages a fairly simple setup would be an MQTT server on your controller, use python to publish and subscribe to messages on the robots.
I suspect the best method for messaging depends on how much data is needed and how fast it has to be passed.

Salatini
Posts: 3
Joined: Fri Feb 03, 2017 1:48 am

Re: Create Ad hoc Network via Wifi or Bluetooth

Fri Feb 03, 2017 10:55 am

Thank you for your reply.
Sorry i mean data not date :D I wanna share some readings from the first robot to the others. I think the Bluetooth Network won't be efficient because it has a low speed of data transfer compared to the Wifi .
So could you please tell me how would i let my Pi Controller to act as a wifi access point and how would it be possible to transfer values from a python code to another in other device ?

Thank you for ur efforts

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Create Ad hoc Network via Wifi or Bluetooth

Fri Feb 03, 2017 11:22 am

https://frillip.com/using-your-raspberr ... h-hostapd/

MQTT, if that is the way you want to handle messaging:
There is a tutorial from Adafruit at https://learn.adafruit.com/diy-esp8266- ... spberry-pi
Also take a look at http://www.ev3dev.org/docs/tutorials/se ... with-mqtt/ which includes publish and subscribe examples which you might use on your robots.

Salatini
Posts: 3
Joined: Fri Feb 03, 2017 1:48 am

Re: Create Ad hoc Network via Wifi or Bluetooth

Fri Feb 03, 2017 5:59 pm

Thank you very much for ur reply :)
i have tried the first code and it worked to make my Pi3 Hotspot .

Iam going to try the MQTT soon. I hope it works too :)

Thank you

Return to “Beginners”