Raspberry Pi 3 and RAK831

Hi,
I’m using the raspberry pi 3 in combination with the RAK831 : I followed the tutorial ( https://www.thethingsnetwork.org/docs/gateways/rak831/ ) => the gateway is working fine … But is it possible to reconfigure the pi so i can use WIFI connection instead of wire ?

Thanks and kind regards

Hi @ON8TLR, great that you are building stuff with balena!

To use the wifi connection, you can choose “wifi” and add your credentials there when you are “adding a device” in the dashboard, see the bottom of this screenshot:

Then your new device will use both Ethernet (if plugged in) and Wifi (if it’s near that network that you set).

You can also see our documentation about how networking is done in balenaOS https://www.balena.io/docs/reference/OS/network/2.x/

You can also check our getting started guide, for example, this: https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/#add-your-first-device There’s a bit more information than in the tutorial that you linked to: https://www.thethingsnetwork.org/docs/gateways/rak831/#add-device Please also note, that the given tutorial is not written by our team, so cannot guarantee to be up to date!

Hope this helps, and let us known if you run into any other problem!

Hi imrehg,

Thanks for the reply => if i’m correct there’s no other way then to re-download and rewrite the image to the SD-card. (with the changes made of course) => found in “wifi setup” (this is found in the boot partition of your image).
Or is there a workaround? Mybe via the “terminal”?
Thanks :wink:

Hey @ON8TLR, there is more information in the link to the docs that was mentioned above: https://www.balena.io/docs/reference/OS/network/2.x/

Easy runtime changes

And yeah, the two most obvious ways I would recommend:

  • if you have the device at hand, get the SD card out, plug it into your development laptop, and add a connection file on the resin-boot partition, system-connections folder (see e.g. https://www.balena.io/docs/reference/OS/network/2.x/#wifi-setup )
  • if you only have remote access, then connect to the host OS in the web terminal or balena ssh (using the CLI), navigate to /mnt/boot/system-connections and add your connection file there (using the vi editor that is in the host OS, or some other way), and then reboot the device (so that the settings take effect). This is a bit more unusual but would work in general.

Future, more advanced stuff

For the future, if you are making other projects, we would also recommend looking at the the wifi-connect project.

This is possible to run on your device next to your application, and can set things up such that your device might be able to bring up an access point, where you can change the wifi settings. But this needs code changes to the project you use, and either you or the maintainer would need to do that.

Mostly mentioning this so you can be aware of this tool, and use it some time if you see it fit.


Hope this helps, and let us know how did it go!

Thanks man it works perfect ! :wink:

Are you connecting to wpa-psk or wpa-enterprise?
I having issue to connect to the wpa-enterprise. Can anyone help?

Hi what kind of issues are you hitting. Are you following the example for Eduroam from https://www.balena.io/docs/reference/OS/network/2.x/#wifi-setup ?

Hi, shaunmulligan.

No. I am using the setting before example for Eduroam in https://www.balena.io/docs/reference/OS/network/2.x/#wifi-setup.

[connection]
id=balena-wifi
type=wifi

[wifi]
ssid=PLACE_SSID_HERE
mode=infrastructure
security=802-11-wireless-security

[wifi-security]
key-mgmt=wpa-eap

[802-1x]
eap=peap
identity=PLACE_YOUR_ID_HERE
phase2-auth=mschapv2
password=PLACE_YOUR_PASSWORD_HERE

[ipv4]
method=auto

[ipv6]
method=auto

I flashed the OS into sd card. Then edited resin-wifi with the settings above. But I cannot connect to the internet and the terminal keeps showing me this (as below) in few minutes time interval.

wlan0: link is not ready
brcmfmac: power management disabled

okay thanks for the info. If you have a connection into the hostOS of the device could you pull the logs fro NetworkManager. Basically can you run journalctl -u NetworkManager --no-pager in the hostOS and attach those logs here. Hopefully that will point to where the issue is.

Hi, additionally you may try running our WiFi Connect project as it has basic Eduroam support as well - https://github.com/balena-io/wifi-connect
Also just in case to ask: you did replace all the three necessary fields there, and rebooted the device, right?
Thanks,
Zahari

@shaunmulligan I try if I can save it to thumbdrive or other external storage. I am using development version so should be ok to locally access.

@majorz ok. I will try on the wifi-connect project.
Yes. I replaced with my ssid, identity and password.
Tested with and without “” also no luck for me.

I try if I can save it to thumbdrive or other external storage. I am using development version so should be ok to locally access.

@Shuuri, in case you find it easier, as you are using a development image, if you have a Windows or Mac laptop, you could enable internet connection sharing on the laptop (docs for Windows, docs for Mac) and connect the RPi to the laptop with an Ethernet cable (in addition to the WiFi configuration). The device will then probably show up on balena’s web dashboard, accessing the internet via the laptop. Then you can ssh to the RPi with a command like:

$ ssh -p 22222 root@X.X.X.X

… replacing X.X.X.X with the device’s IP address, shown on the web dashboard.

Then you can run the journalctl command mentioned by Shaun, in the ssh session, and copy-and-paste it. Even though the device will be connected to the internet via Ethernet, the logs should still include WiFi errors.

Guys,

A sudden question pops in my head.
Will special characters affecting the credential authentication? There are special characters in the secret key. Do I need to use any method to input the special characters such as ~!@#$%^&*()-_?

[Update]

I followed the guide from @shaunmulligan which ran the command journalctl -u NetworkManager --no-pager in the hostOS. Attached is the log retrieved.networkmanager.log (51.3 KB)

I noticed that the connection initially established successfully. But, it later triggered <warn> [1568725945.5272] sup-iface[0xf682a0,wlan0]: connection disconnected (reason -15). Then, got disconnected.

image

Hi @Shuuri, there could be a number of reasons for why it is failing like this. This needs to be narrowed down more.

First possibility is that some Eduroam networks could be configured slightly differently. Do you have access to some documentation about the configuration settings of the network you are connecting to? Usually the network admins publish it on the University websites.

Second option is to try to connect to the network with a WiFi dongle. This will differentiate whether it is a problem with the WiFi chipset/driver.

Third option is to try out a different wpa_supplicant version. This is also a possibility for the origin of the problem. In balenaOS v2.45 we upgraded the version of wpa_supplicant. It is currently not released, but should appear very soon for download on https://dashboard.balena-staging.com/. Afterwards it will be released for production as well. Once it appears on staging you may download the new OS version and try it out.

Please let me know if you have any questions.

Thanks,
Zahari

Hi @majorz,

Thanks for your reply.

First possibility – I don’t have any access to the documentation. I just have the wpa_suppliant configuration when using on Raspbian official OS.

Okay, I will check with WiFi dongle. As I know, WiFi chipset/driver shouldn’t have any problem since it working fine when I changed sd card which contains Raspbian official OS.

I will check on the coming-soon balenaOS v2.45