balena-io / docs

Documentation for the balenaCloud platform.
https://docs.balena.io/
Apache License 2.0
68 stars 366 forks source link

Doc how to setup GSM, wifi and other types of connectivity on resinOS 2.0 #378

Closed shaunmulligan closed 7 years ago

shaunmulligan commented 7 years ago

Tags: cellular, modem, 3G

Front logo Front conversations

shaunmulligan commented 7 years ago

https://github.com/resin-io/hq/issues/115

shaunmulligan commented 7 years ago

To get WPA2-enterprise on networkManager add:

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

[connection]
id=resin-wifi
type=wifi

[ipv6]
method=auto

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

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

[ipv4]
method=auto
shaunmulligan commented 7 years ago

This is a example of a simple gsm example, just drop the below example configuration into a file in the /boot/system-connections directory on the SD card and name it something like cellular. Replace the apn= value with your carriers APN value

[connection]
id=Cellular
type=gsm
autoconnect=true

[gsm]
apn=soracom.io
number=*99***1#
password-flags=1

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

If you carrier has a password and username use something like the following:

[connection]
id=Cellular
type=gsm
autoconnect=true
permissions=
secondaries=

[gsm]
apn=general.t-mobile.uk
number=*99#
password=mms
username=User

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=auto

Known working modems:

shaunmulligan commented 7 years ago

Note

On raspberry pi devices, its often useful to set the following configuration in your config.txt to get the most amperage out of the USB (if it is a USB dongle of course):

max_usb_current=1
safe_mode_gpio=4
shaunmulligan commented 7 years ago

Known Tested Modems:

memolipd commented 7 years ago

I struggling to get the Huawei E3531s-1 working. I'm using v2.0.0.rc1.rev2. Im trying to connect it onto a Giffgaff network. The device shows up inside my containers as ppp0 but doesn't seem to be working. Is there anyway to debug this?

this config makes the device show up as ppp0:

[connection]
id=Cellular
type=gsm
autoconnect=true

[gsm]
apn=giffgaff.com
number=*99***1#
password-flags=1

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

but giffgaff forums suggest these settings are whats needed: https://community.giffgaff.com/t5/Tips-Guides/Dongle-Settings/m-p/1924153#M21350

but using a compatible config results in no device being shown in ifconfig.

dmesg seems to report no specifc errors, it's mapping correctly:


[   30.463116] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[   30.470055] option 1-1.2:1.3: GSM modem (1-port) converter detected
[   30.478831] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[   32.195923] sr 1:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[   32.202238] sr 1:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[   32.208546] sr 1:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[   32.215077] sr 1:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 ff fc 00 00 02 00
[   32.221660] blk_update_request: critical medium error, dev sr0, sector 262128```
shaunmulligan commented 7 years ago

@memolipd thats very odd, I have been using giffgaff with a bunch of different modems. This is my usual config:

[connection]
id=giffgaff Mobile Broadband
type=gsm
autoconnect=true
permissions=
secondaries=

[gsm]
apn=giffgaff.com
number=*99#
password=password
username=giffgaff

[serial]
baud=115200

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=ignore
memolipd commented 7 years ago

@shaunmulligan That did it.

I realised it only seems to work when the network cable is unplugged!

whats the best way to debug networking issues in the host resin OS?

floion commented 7 years ago

You should be able to have -dev (development) images available soon and for those you can use the serial console to login in the host Os and do whatever checks you need to do in order to debug various isues

shaunmulligan commented 7 years ago

This should all now be covered in https://docs.resin.io/deployment/network/2.0.0/