C++ client server multi-threaded programming trouble

Well… a post after a very long time… I just thought to update about my project :slightly_smiling_face: (ad-hoc networking between multiple Raspberry Pi clients and a Windows laptop server).

Currently I am trying to connect a Raspberry Pi B+ client (Raspbian Stretch) to a Windows 10 server (laptop) but I am unable to do so in ad-hoc mode. Whereas, two Raspberry Pis are easily pinging each other in ad-hoc mode (connection established and ping successful). I have manually assigned IPs (static) to laptop but still no connection establishment.

What do you suggest ? Should I abandon this idea of making laptop a server and two Raspberry Pis clients (A and B) and instead make another Raspberry Pi a server as well so then all (ad-hoc) communication will be among Pis. Or is there a way to connect Pi and laptop in ad-hoc mode ?

P.S. I have already tried all the tutorials I found on the internet; nothing worked so far.

Hi @shahwani,

The main disadvantages of ad-hoc networks are that:

  • Attackers have an easier way to mangle your network due to the fact that the SSID’s will always be broadcasted.

  • And the performance of the network decreases as the number of devices increases. If you’ve got lots of devices connected to your laptop, then you may have a performance hit.

Now, if you don’t have issues with the above 2 disadvantages, then you can still follow the ad-hoc networking path.

I understand that 2 Raspberry Pi's communicate well when they are both running in ad-hoc mode, but you run into issues when you add a Windows machine into the equation.

If I were you, I’d run Linux on the laptop - you can easily fire up a virtual machine within your Windows OS. Running a Linux on the laptop as opposed to Windows could help you get rid of the said issues just because you’re going to use the same OS on all machines, thus reducing the chance of having incompatibilities.

By the way, I’d use a Debian-derived OS on your laptop, because the Pi also runs on a Debian-based OS.

Hope this helps you with your project.

Thank you!

Hey there! Good to hear back from you :grinning:

I tried installing Debian 9 with iso image on my USB (efi boot) but I ran into issues while doing the Guided partitioning in Graphical installer. I guess, I’m quite new to all this and instead of complicating things may be it’s a better idea to just stick to Pis.

Anyway, I tried Ubuntu as well. It’s now installed and working (although it’s still booting with Windows first but that’s fine!). Issue is >> I am unable to ‘enable Wifi’ on Ubuntu. Internet is working fine with Ethernet (LAN cable connected) but not with Wifi (ad-hoc).

Secondly, I need to build a User Interface (UI) on Python3 that takes user input from a 4x4 matrix keypad along with GPS coordinates (I’m using Grove GPS without Pi-plus shield, i.e. no RPiser) and I believe twisted can be used there? Should or shouldn’t I use it?

Lastly, Is there a pre-written code that carry out such tasks. It will save me time of writing a code from scratch. Once a client (Pi2) presses some keys on the keypad (message formation), this input reaches server (another Pi) that is connected in ad-hoc mode with the client, the the server carries out a certain task, stores that information somewhere on the hard disk (in a file, for instance), or print some message on screen/display and then might send this information to some other client (again a Raspberry Pi) on the same ad-hoc network. I hope I’m making myself clear here :slight_smile: