HL7800 as a network interface in Linux

Hi,

Has anyone got a guide or similar to how to make a HL7800-module which is connected by USB appear as a networking interface in Linux? I’m not too familiar with PPP, as I assume should be used? Can I use any guide for LTE USB modems with Linux online or do I need anything special with these modems?

Best regards,
Gustav

Hi @gustav.sohtell,

I assume that HL7800 is already in USB mode. You can confirm this with AT+KUSBCOMP? command. If it returns “1”, that means device is in USB mode.

Once in USB mode, you will see three ttyACMx ports. Typically, ttyACM0, ttyACM1 and ttyACM2.

USB-ACM0 — AT port

USB-ACM1 — AT/PPP data port

USB-ACM2 — NMEA data port

I will recommend to you ACM1 as your PPP port.

  • You will also need PPP daemon installed on your host. Check that pppd is available with pppd version

  • Check that your kernel is built with the ppp module: uname -a; dmesg | grep -i ppp

  • Before configuring the ppp link, check first you can connect to your ISP (Internet Service Provider) manually. Send manually ATDT123 (or “ATD99**1#” for later releases). You should get a response of “CONNECT or CONNECTED”. Then close the AT link.

  • Create an /etc/chatscripts/hl78xx-chat file which contains:
    ABORT BUSY
    ABORT “NO CARRIER”
    ABORT VOICE
    ABORT “NO DIALTONE”
    ABORT “NO ANSWER”
    ABORT DELAYED
    ABORT ERROR
    TIMEOUT 10
    “” AT
    OK "ATD99**1#"
    CONNECT

  • Create an /etc/ppp/peers/hl78xx file which contains:

noauth
connect “/usr/sbin/chat -v -t 5 -f /etc/chatscripts/hl78xx-chat”
debug
/dev/ttyACM1
115200
defaultroute
noipdefault
usepeerdns
lcp-echo-interval 20
noaccomp

  • Launch PPP session with : sudo pppd call hl78xx

  • If PPP was successfully established, “ifconfig” should show something like:

ppp0 Link encap:Point-to-Point Protocol

inet addr:10.0.0.10 P-t-P:1xx.xx.xx.xx Mask:255.255.255.255

UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1

RX packets:7 errors:0 dropped:0 overruns:0 frame:0

TX packets:7 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:3

RX bytes:345 (345.0 B) TX bytes:201 (201.0 B)

  • If you have access to the embedded Linux shell, the syslog file shows very useful information about the ppp connection.

=======================

I have also uploaded PPP chatscripts that you can use.
PPP.7z (422 Bytes)

Thank you very much for your detailed post, AE5000. Very helpful! I’ll see if we can make this work.

Hi, we got stuck very quickly.
ATDT123 directly gives the reply “ERROR”.

AT+KUSBCOMP gives 1.

What could be the potential reasons that ATDT could return just “ERROR”?

Best regards,
Gustav

ATD=? also gives
ERROR

Found another thread which specifies a different ATDT command… That gave some results. Perhaps that is good :slight_smile:

ATDT99**1#

CONNECT

~?}#?!}!}!} }4}"}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}!}!} }4}”}&} } } } }%}&}9+?}2}’}"}(}“u}0~~?}#?!}%}”} }0User requestS3~

NO CARRIER

Aha! when I posted my own answer I found part of the problem. This forum system removes stars. The command is always ATD*99***1# but if I write it here it removes some stars, like this: ATD99**1#

HI @gustav.sohtell,

My earlier reply also suggested use of “ATD* 99** *1#”. The attached chatscripts also use the same command. Please use the same. It should work.

Hi,
I am working on this as well with Gustav.
I have followed the guide by creating the chatscript and pppd files that you linked in the zip archive. However, the interface doesn’t show up when doing ifconfig. I add debug in the pppd script but I don’t think it gives any more information.
This is what syslog shows:

daemon.notice pppd[2267]: pppd 2.4.7 started by root, uid 0
local2.info chat[2268]: abort on (BUSY)
local2.info chat[2268]: abort on (NO CARRIER)
local2.info chat[2268]: abort on (VOICE)
local2.info chat[2268]: abort on (NO DIALTONE)
local2.info chat[2268]: abort on (NO ANSWER)
local2.info chat[2268]: abort on (DELAYED)
local2.info chat[2268]: timeout set to 10 seconds
local2.info chat[2268]: send (AT^M)
local2.info chat[2268]: expect (OK)
local2.info chat[2268]: alarm
local2.info chat[2268]: Failed
daemon.debug pppd[2267]: Script /usr/sbin/chat -v -t 5 -f /etc/chatscripts/hl78xx-chat
 finished (pid 2268), status = 0x3
daemon.err pppd[2267]: Connect script failed

When calling “ATD99**1#” manually the output that Gustav posted above shows up, ending with NO CARRIER. ppp version is 2.4.7.

Best Regards
Jesper

Hi @jesper.persson,
Please confirm that right “ttyACM” port is used in “hl78xx” file. The one I sent had ttyACM1. On your platform it may be different.

noauth
connect “/usr/sbin/chat -v -t 5 -f /etc/chatscripts/hl78xx-chat”
debug
/dev/ttyACM1
115200
defaultroute
noipdefault
usepeerdns
lcp-echo-interval 20
noaccomp

Provide the list of ttyACM ports on your platform before and after HL78xx enumerates. This will tell us what ports are assigned to HL78xx.

The issue you are experiencing is that AT command are timing out. Very likely it has to do with providing the right port to PPP scripts.

Hi @AE5000,
It is using /dev/ttyACM1.
The other ACM devices are /dev/ttyACM0 and /dev/ttyACM2.

I’ve tried both of the devices, with ttyACM2 the error is the same and with ttyACM0 the syslog shows:

daemon.notice pppd[4855]: pppd 2.4.7 started by root, uid 0
local2.info chat[4856]: abort on (BUSY)
local2.info chat[4856]: abort on (NO CARRIER)
local2.info chat[4856]: abort on (VOICE)
local2.info chat[4856]: abort on (NO DIALTONE)
local2.info chat[4856]: abort on (NO ANSWER)
local2.info chat[4856]: abort on (DELAYED)
local2.info chat[4856]: timeout set to 10 seconds
local2.info chat[4856]: send (AT^M)
local2.info chat[4856]: expect (OK)
local2.info chat[4856]: AT^M^M
local2.info chat[4856]: OK
local2.info chat[4856]:  -- got it
local2.info chat[4856]: send (AT^M)
local2.info chat[4856]: expect (OK)
local2.info chat[4856]: ^M
local2.info chat[4856]: AT^M^M
local2.info chat[4856]: OK
local2.info chat[4856]:  -- got it
local2.info chat[4856]: send (ATD*99***1#^M)
local2.info chat[4856]: expect (CONNECT)
local2.info chat[4856]: ^M
local2.info chat[4856]: ATD*99***1#^M^M
local2.info chat[4856]: CONNECT
local2.info chat[4856]:  -- got it
local2.info chat[4856]: send ()
daemon.debug pppd[4855]: Script /usr/sbin/chat -v -t 5 -f /etc/chatscripts/hl78xx-chat finished (pid 4856), status = 0x0
daemon.info pppd[4855]: Serial connection established.
daemon.err pppd[4855]: Couldn't set tty to PPP discipline: Invalid argument
daemon.info pppd[4855]: Exit.

Best Regards
Jesper

1 Like

Let me look into this and try at my end. Will get back soon.

Hi @jesper.persson,
I tried it on my setup. It is working well. Sometimes you may have to relaunch PPP.

Here is how I started PPP session:
ppp

Here is the Syslog which shows the connection was successful. Note that I am testing with Verizon SIM. So I have to use “ATD*99***3#” instead of “ATD*99***1#”.
ppp_syslog.txt (8.1 KB)

Hi,
I tried with all three devices and also with “ATD*99***3#” but still not seeing any ppp0 interface.
We are using CAT-M1 if that makes any difference.

Best Regards
Jesper

Hi,
I tried upgrading the firmware to the latest version. Now I am getting this error instead:

pppd[5676]: pppd 2.4.8 started by root, uid 0
chat[5677]: abort on (BUSY)
chat[5677]: abort on (NO CARRIER)
chat[5677]: abort on (VOICE)
chat[5677]: abort on (NO DIALTONE)
chat[5677]: abort on (NO ANSWER)
chat[5677]: abort on (DELAYED)
chat[5677]: timeout set to 10 seconds
chat[5677]: send (AT^M)
chat[5677]: expect (OK)
chat[5677]: AT^M^M
chat[5677]: OK
chat[5677]:  -- got it
chat[5677]: send (AT^M)
chat[5677]: expect (OK)
chat[5677]: ^M
chat[5677]: AT^M^M
chat[5677]: OK
chat[5677]:  -- got it
chat[5677]: send (ATD*99***1#^M)
chat[5677]: expect (CONNECT)
chat[5677]: ^M
chat[5677]: ATD*99***1#^M^M
chat[5677]: CONNECT
chat[5677]:  -- got it
pppd[5676]: Serial connection established.
pppd[5676]: Couldn't set tty to PPP discipline: Invalid argument
pppd[5676]: Exit.

Hi @jesper.persson,

This error is not from the HL device. It has something to do with the PPP daemon and related setup. HL device is already in PPP mode (CONNECT).

You will have to investigate this from the host/Linux side.

Ok, thanks a lot for all the help @AE5000!

Hi @AE5000, thanks for the detailed steps above, i have just one question about how can i get the syslog (port to use, config …) i use my HL78 with Linux pc