PiSupply / iot-lora-image

RPi SD Card Image for IoT LoRa Range
11 stars 6 forks source link

4G Module Testing #17

Closed ryanteck closed 4 years ago

ryanteck commented 5 years ago

Perform testing to ensure the 4G Modules work fine primarily for our Standalone Gateway but also for normal gateway with Pijuice Data

Module List:

Ideally with modem manager

ryanteck commented 5 years ago

Modem all working on ubuntu. Now to test on RPi

Speeds are fairly good for indoors.

Notes from ubuntu

5017.739686] usb 1-3: new high-speed USB device number 5 using xhci_hcd [ 5017.902929] usb 1-3: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18 [ 5017.902937] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 5017.902940] usb 1-3: Product: Android [ 5017.902944] usb 1-3: Manufacturer: Android [ 5018.559305] usbcore: registered new interface driver usbserial_generic [ 5018.559327] usbserial: USB Serial support registered for generic [ 5018.575214] usbcore: registered new interface driver option [ 5018.575241] usbserial: USB Serial support registered for GSM modem (1-port) [ 5018.575347] option 1-3:1.0: GSM modem (1-port) converter detected [ 5018.575865] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB0 [ 5018.576259] option 1-3:1.1: GSM modem (1-port) converter detected [ 5018.577443] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB1 [ 5018.579265] option 1-3:1.2: GSM modem (1-port) converter detected [ 5018.579837] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB2 [ 5018.581069] option 1-3:1.3: GSM modem (1-port) converter detected [ 5018.581633] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB3 [ 5018.588746] usbcore: registered new interface driver cdc_wdm [ 5018.597910] qmi_wwan 1-3:1.4: cdc-wdm0: USB WDM device [ 5018.600960] qmi_wwan 1-3:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:15.0-3, WWAN/QMI device, be:1c:e8:49:e0:ac [ 5018.603834] usbcore: registered new interface driver qmi_wwan Screenshot from 2019-06-30 21-37-28

ryanteck commented 5 years ago

Install package modemmanager and network managers.

Connected

ryanteck commented 5 years ago

Ok got this mostly working however requires some more testing.

ryanteck commented 5 years ago

Ok so here's the following:

With modem manager and network manager installed the device claims to connect. It seems to get an IP etc.

However it is just not wanting to make any requests at all. More investigation will be needed but I won't do this for quite a while now.

ryanteck commented 5 years ago

Tested the SIM7100 with even less success.

On raspberry pi both seem to require quite a bit of compiling or configuration.

ryanteck commented 5 years ago

More luck / success has been had with the SIm7100 but still not reliable.

Putting this on hold however will be a issue that needs fixing / significant looking into for the standalone gateway.

ryanteck commented 5 years ago

Will need to re-continue work on this.

To begin include network-manager and modem manager packages into image.

ryanteck commented 4 years ago

Going to target this for V4 Release Instead.

ryanteck commented 4 years ago

This will be targeted for September Release

ryanteck commented 4 years ago

After even more debugging I have got success.

The main thing I've been struggling with is figuring out when using the same configuration files, packages, everything as identical as I could see between my Ubuntu Machines and Debian what was causing it to not work.

Eventually I found that for some reason Debian isn't configuring the module to work in the correct mode.

raw_ip set by qmi

root@iotloragateway:~# nmcli connection down three
root@iotloragateway:~# ip link set dev wwan0 down
root@iotloragateway:~# echo Y > /sys/class/net/wwan0/qmi/raw_ip
root@iotloragateway:~# ip link set dev wwan0 up
root@iotloragateway:~# nmcli connection up three
ryanteck commented 4 years ago

Ok, need to create a little bash script / service that will do this instead. Maybe have it check if one of our 4G modules are used instead.

Quectel works. sim7100e doesn;t/

ryanteck commented 4 years ago

Ok designing the following code:

Look for devices on 2c7c:0125 2c7c:0125

ryanteck commented 4 years ago

File made to do the changes, along with udev rule to automatically configure it.

Just need to implement the web UI to get going with this and then this will be in the next release.

ryanteck commented 4 years ago

For some reason having some issues with this again so will need looking into.

ryanteck commented 4 years ago

https://techship.com/faq/how-to-step-by-step-set-up-a-data-connection-over-qmi-interface-using-qmicli-and-in-kernel-driver-qmi-wwan-in-linux/

ryanteck commented 4 years ago

/etc/udev/rules.d/42-iot4g.rule ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", RUN+="/opt/iotloragateway/iot-lora-gw-docker/4GInserted.sh"

ryanteck commented 4 years ago

Working on this now.

sudo nmcli c add type gsm ifname cdc-wdm0 apn internet con-name iot3g

ryanteck commented 4 years ago

Going to try to also add support for SIM7100E if possible.

ryanteck commented 4 years ago

Tryint to re-start from scratch a little.


ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1"
ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AUDIO}="1"```
ryanteck commented 4 years ago

can use ifmetric for priority

ryanteck commented 4 years ago

Edit resolvconf.conf to add google nameservers to the top

If you run a local name server, you should uncomment the below line and

configure your subscribers configuration files below.

name_servers=8.8.8.8,1.1.1.1