Manage Wifi connections on Raspberry PI

Gerharddc

I am working on using a Raspberry Pi in an embedded project that will utilize wifi to communicate with external devices. The device should be able to act either as a standalone wifi hotspot that devices can connect to or in the case of the presence of an existing wifi network it should connect to that network so that the user does not have to give up his internet connection in order to connect to the device. I plan on making the device start up in hotspot mode, the user can then use the web interface to enter the details of a network that he wants the device to connect to, whenever the specified parameters fails to establish a connection then it defaults back to hotspot mode.

Now the technical stuff I am struggling with is that I want to implement the control software in C# running with Mono on Arch Linux on the Rapsberry Pi. I am struggling the find the Apis or libraries needed to manage the Linux wifi connection. On Windows it seems as if managedwifi.codeplex.com can be used but it does not seem to be compatible with Linux.

My last resort would obviously be to execute shell commands and then parse their outputs, but considering how crude and possibly unreliable that would be this is obviously my last resort.

Any ideas regarding what I should do?

PS. Another thing I might consider before using shell scripts, if it makes a difference is to use Raspbian or some other distro instead.

el_shayan
  1. Actually calling shell commands from a managed code is not a very bad idea. They are reliable, very well tested and mostly lightweight and sometimes just a wrapper around kernel or other modules function. This is also seems to be the same method Node.js modules use when they want to access something lowlevel or related to networking. For example see this source code: node-wireless/node_modules/wireless/index.js

  2. If you don't like it this way there is always "Interop". The same way that you can DllImport() libraries in Windows, you can do in Linux. See here: http://www.mono-project.com/Interop_with_Native_Libraries

IMHO the second solution doesn't worth the effort. Calling shell commands is elegant and neat enough.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Raspberry Pi WiFi Repeater Issues

From Dev

Raspberry Pi to Ardunio Pro Micro Serial connections

From Dev

Bridge Wifi to Raspberry Pi using Ethernet Cable

From Dev

Python Socket over wifi in raspberry pi

From Dev

Connect to wifi using Python on Raspberry Pi

From Dev

Python Socket over wifi in raspberry pi

From Dev

Raspberry PI wifi hotspot slow internet speed

From Dev

Raspberry pi 3 bridge Wifi to Lan

From Dev

Connecting Raspberry Pi running Android Things to wifi

From Dev

Connect raspberry pi 4 with ubuntu server to wifi

From Dev

How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

From Dev

How to connect wifi network from raspberry pi 2 (snappy)

From Dev

How to connect wifi network from raspberry pi 2 (snappy)

From Dev

Different iw list for the same USB Wifi device on Raspberry pi and ubuntu

From Dev

Raspberry Pi 3 - Local Static Network - Wifi and Ethernet

From Dev

Kali Linux on a Raspberry pi 3 model b - WiFi problems

From Dev

How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

From Dev

windows IoT compatible wifi dongle not recognised on raspberry PI 2

From Dev

Is the Raspberry Pi able to stream Full HD over wifi?

From Dev

Connecting to Remote Desktop on Raspberry Pi after wifi has changed

From Dev

Raspberry PI 3: Wireless hotspot (from WiFi to WiFi instead of ethernet to WiFi)

From Dev

How do I open up my MySQL on my Raspberry Pi for Outside / Remote Connections?

From Dev

Why VS2015 can't find my Raspberry Pi 2 in the Remote Connections dialog?

From Dev

Can't manage to update raspberry pi, gpio-header html file

From Dev

How to get the wifi working with r8188eu driver on my raspberry pi?

From Dev

How to set up WiFi on Ubuntu 19.10 Server running on Raspberry Pi 4?

From Dev

How to share a folder on Ubuntu to Raspberry Pi 3 over local WiFi network?

From Dev

Fedora 29 ARM on raspberry pi3b+ cannot connect to wifi

From Dev

how to connect to WPA2 enterprise WiFi in Ubuntu Core Raspberry Pi 3

Related Related

  1. 1

    Raspberry Pi WiFi Repeater Issues

  2. 2

    Raspberry Pi to Ardunio Pro Micro Serial connections

  3. 3

    Bridge Wifi to Raspberry Pi using Ethernet Cable

  4. 4

    Python Socket over wifi in raspberry pi

  5. 5

    Connect to wifi using Python on Raspberry Pi

  6. 6

    Python Socket over wifi in raspberry pi

  7. 7

    Raspberry PI wifi hotspot slow internet speed

  8. 8

    Raspberry pi 3 bridge Wifi to Lan

  9. 9

    Connecting Raspberry Pi running Android Things to wifi

  10. 10

    Connect raspberry pi 4 with ubuntu server to wifi

  11. 11

    How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

  12. 12

    How to connect wifi network from raspberry pi 2 (snappy)

  13. 13

    How to connect wifi network from raspberry pi 2 (snappy)

  14. 14

    Different iw list for the same USB Wifi device on Raspberry pi and ubuntu

  15. 15

    Raspberry Pi 3 - Local Static Network - Wifi and Ethernet

  16. 16

    Kali Linux on a Raspberry pi 3 model b - WiFi problems

  17. 17

    How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

  18. 18

    windows IoT compatible wifi dongle not recognised on raspberry PI 2

  19. 19

    Is the Raspberry Pi able to stream Full HD over wifi?

  20. 20

    Connecting to Remote Desktop on Raspberry Pi after wifi has changed

  21. 21

    Raspberry PI 3: Wireless hotspot (from WiFi to WiFi instead of ethernet to WiFi)

  22. 22

    How do I open up my MySQL on my Raspberry Pi for Outside / Remote Connections?

  23. 23

    Why VS2015 can't find my Raspberry Pi 2 in the Remote Connections dialog?

  24. 24

    Can't manage to update raspberry pi, gpio-header html file

  25. 25

    How to get the wifi working with r8188eu driver on my raspberry pi?

  26. 26

    How to set up WiFi on Ubuntu 19.10 Server running on Raspberry Pi 4?

  27. 27

    How to share a folder on Ubuntu to Raspberry Pi 3 over local WiFi network?

  28. 28

    Fedora 29 ARM on raspberry pi3b+ cannot connect to wifi

  29. 29

    how to connect to WPA2 enterprise WiFi in Ubuntu Core Raspberry Pi 3

HotTag

Archive