1

I (and a few others) are working on a game a la Lingo. For that we want to have 1 host Pi to which the team Pi's can connect to. This connection would be used to send strings from the teams Pi to the host Pi that contain their guesses. We are using c# and running Windows IoT Core.

We have been at this for about 2 weeks but have not been able to get a connection going. We have found multiple ways we should be able to communicate through, yet none of them seem to be working.

Does anyone here know of a simple way to (wirelessly) communicate from Pi to Pi without having to use other hardware (ie. a PC).

Cheers!

We have been looking at using Stream Sockets for a while, but haven't been able to get it to work (yet). In my mind the connection should be made immediatly after starting the the program, without user interaction.

3
  • To avoid retreading ground you've already covered it would be really helpful if you could outline/provide a couple of buzz words around what you've already tried. For more than 2 players, you're more than likely looking at implementing a client/server architecture here - you really want the core game system running as its own process somewhere, then each player communicating with the server rather than directly with each other.
    – goobering
    Jan 26 '17 at 14:44
  • @goobering You're right, can you tell I'm new to this? :p But yeah, that was kind of what we had in mind, the host Pi acting as server and the teams as clients.
    – Daan
    Jan 27 '17 at 12:28
  • This looks to me like a C# programming question. Also, this is not a discussion forum, and "brainstorm with me" type questions are not appropriate (please read "What types of questions should I avoid asking?"). I would suggest you come up with something more focussed and ask on our larger parent site, Stack Overflow, but beware they will expect to see some code, not "we've tried everything and nothing works". If you just want links to resources, use a search engine.
    – goldilocks
    Jan 27 '17 at 14:10
2

If I were the programmer, my game plan would be

  1. One Pi would be a WiFi access point with a static IP (also contains game host logic).
  2. Several client Pis, pre-configured with the host's PSK keys. DHCP.

From there, use bi-directional sockets. Should be simple enough to implement in C#.

String should contain Player ID (because of DHCP) and guess/answer. JSON recommended.

Source: I know my way around C#.

3
  • I love the access point host concept for local gaming. Should be fairly straightforward to rejig it for use on a remote server if you wanted to play over WAN too.
    – goobering
    Jan 26 '17 at 16:45
  • We've been looking at using Stream Sockets for a while, however have been having a lot of trouble getting it to work, do you know of a different way to start a connection, or (better yet) do you know of a page which has good explanations and which steps to take?
    – Daan
    Jan 27 '17 at 13:48
  • @Daan You don't really need to have the socket continuously opened. You can go ahead and close it after sending the string. It's difficult managing a constantly-opened socket, and you'd have to implement a detection method to know if the string was fully sent. Simply closing the socket usually informs both parties that everything is done.
    – Aloha
    Jan 27 '17 at 14:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.