Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: sodface on July 25, 2018, 06:48:46 PM
-
I'm looking for ppp.tcz and it's modules for v6 on a Pi Zero W but they don't seem to be in the repo. wvdial.tcz.tree lists it as a dependency but doesn't list the kernel modules as a dependency for ppp like v7 does:
http://tinycorelinux.net/9.x/armv6/tcz/wvdial.tcz.tree
wvdial.tcz
wvstreams.tcz
openssl.tcz
ca-certificates.tcz
readline.tcz
ncurses.tcz
ppp.tcz
http://tinycorelinux.net/9.x/armv7/tcz/ppp.tcz.tree
ppp.tcz
ppp-modules-4.9.22-piCore-v7.tcz
I think I know where to get the v6 modules but would I need to compile ppp from scratch for v6? I need to use all v6 on the Pi Zero W is that right?
-
ppp-modules-4.9.22-piCore created and ppp copied to piCore 9.x armv6 repo - ppp not tested, but I presume it will work
-
Thanks Juanito! Will test and report.
-
Trying to test. I have a Huwei USB modem that I bought several years ago. I recently got it working with Raspbian but have yet to get it working with piCore. I'll keep at it.
-
Still struggling. With Raspbian and wvdial/ppp I'm able to get the modem to connect and get an IP address on the ppp0 interface but with piCore as soon as wvdial says modem initialized it seg faults.
-
Sorry I can't offer any help. If you succeed, I would certainly be interested. About a year ago on PiCore 8.X.X I tried with an old Huawei E173 and eventually gave up. I think I got as far as it getting an IP address, but I was never able to see anything on the internet.
I moved to a ZTE MF730M that just worked without any software installed. It needs preconfiguring with carrier, APN username and passworwd using a Java enabled browser ( I used my Ubuntu laptop), then on piCore it created a new network interface usb0. all you need to get connected is
ifconfig usb0 up
udhcpc -i usb0
-
Tim - I'm using a Huawei E173 and was just now able to get connected using pppd on it's own without wvdial. ppp0 device got an IP and a default route was created automatically but I had to add a nameserver entry to /etc/resolv.conf before I could ping by name.
I'll do a longer write up later.
-
I used this Arch write-up:
https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd#.2Fetc.2Fppp.2Foptions-mobile
From a fresh minimal piCore boot, no extensions loaded on boot, load only three:
tc@box:~$ tce-status -i
ppp
ppp-modules-4.9.22-piCore
usb-serial-4.9.22-piCore
Below is a condensed command line version of the steps. The first part are just the commands I pasted into a text file (without output) as a way of keeping notes, and then at the end starting at the pon command, that's copied and pasted right out of the terminal window. The contents of the /etc/ppp directory as well as the pon, poff, and plog scripts I tar'd up off the working Raspbian instance I tested on earlier today. Basically, I got it working on Raspbian and then took the bits I needed over to piCore. The symlinks are needed to keep the pon, poff and plog scripts working as written. Not really sure how to package this up yet and I'm wondering about the mods to /etc directly, best practice would have you add that stuff to /usr/local/etc right? I'm not sure that you can tell pppd to look there via a command line option.
~$ tce-load -i ppp-modules-4.9.22-piCore.tcz
~$ tce-load -i ppp.tcz
~$ tce-load -i usb-serial-4.9.22-piCore.tcz
~$ sudo su
# cd /etc
# cp /mnt/mmcblk0p1/tce/optional/ppp.tgz
# tar -zxvf ppp.tgz
ppp/
ppp/options
ppp/chatscripts/
ppp/chatscripts/mode.NONE
ppp/chatscripts/mobile-modem.chat
ppp/chatscripts/mode
ppp/chatscripts/mode.3G-pref
ppp/chatscripts/apn.hologram
ppp/chatscripts/pin.NONE
ppp/chatscripts/pin
ppp/chatscripts/apn
ppp/chatscripts/mode.3G-only
ppp/ipv6-up.d/
ppp/options-mobile
ppp/ipv6-up
ppp/ip-down
ppp/ipv6-down.d/
ppp/ip-down.d/
ppp/ip-down.d/0000usepeerdns
ppp/ip-down.d/000resolvconf
ppp/peers/
ppp/peers/provider
ppp/peers/mobile-auth
ppp/peers/mobile-noauth
ppp/peers/provider.old
ppp/ip-up.d/
ppp/ip-up.d/0000usepeerdns
ppp/ip-up.d/000resolvconf
ppp/ipv6-down
ppp/ip-up
# chown -R root:staff ppp
# cd /usr/local/sbin/
# cp /mnt/mmcblk0p1/tce/optional/ppp_scripts.tgz .
# tar -zxvf ppp_scripts.tgz
pon
plog
poff
# ln -s /usr/local/sbin/pppd /usr/sbin/pppd
# ln -s /usr/local/sbin/chat /usr/sbin/chat
# ln -s /var/log/messages /var/log/syslog
root@box:/usr/local/sbin# pon
root@box:/usr/local/sbin# plog
Jan 1 00:14:12 box local2.info chat[941]: ATQ0 V1 E1 S0=0 &C1 &D2^M^M
Jan 1 00:14:12 box local2.info chat[941]: OK
Jan 1 00:14:12 box local2.info chat[941]: -- got it
Jan 1 00:14:12 box local2.info chat[941]: send (AT\^SYSCFG=2,2,3fffffff,0,1^M)
Jan 1 00:14:12 box local2.info chat[941]: expect (OK)
Jan 1 00:14:12 box local2.info chat[941]: ^M
Jan 1 00:14:12 box local2.info chat[941]: AT^SYSCFG=2,2,3fffffff,0,1^M^M
Jan 1 00:14:12 box local2.info chat[941]: OK
Jan 1 00:14:12 box local2.info chat[941]: -- got it
Jan 1 00:14:12 box local2.info chat[941]: send (AT+CGDCONT=1,"IP","hologram"^M)
root@box:/usr/local/sbin# plog
Jan 1 00:14:16 box daemon.debug pppd[939]: rcvd [IPCP ConfNak id=0x4 <addr 10.170.147.164> <ms-dns1 212.9.0.135> <ms-dns2 212.9.0.136>]
Jan 1 00:14:16 box daemon.debug pppd[939]: sent [IPCP ConfReq id=0x5 <addr 10.170.147.164> <ms-dns1 212.9.0.135> <ms-dns2 212.9.0.136>]
Jan 1 00:14:16 box daemon.debug pppd[939]: rcvd [IPCP ConfAck id=0x5 <addr 10.170.147.164> <ms-dns1 212.9.0.135> <ms-dns2 212.9.0.136>]
Jan 1 00:14:16 box daemon.warn pppd[939]: Could not determine remote IP address: defaulting to 10.64.64.64
Jan 1 00:14:16 box daemon.notice pppd[939]: local IP address 10.170.147.164
Jan 1 00:14:16 box daemon.notice pppd[939]: remote IP address 10.64.64.64
Jan 1 00:14:16 box daemon.notice pppd[939]: primary DNS address 212.9.0.135
Jan 1 00:14:16 box daemon.notice pppd[939]: secondary DNS address 212.9.0.136
Jan 1 00:14:16 box daemon.debug pppd[939]: Script /etc/ppp/ip-up started (pid 950)
Jan 1 00:14:17 box daemon.debug pppd[939]: Script /etc/ppp/ip-up finished (pid 950), status = 0x0
root@box:/usr/local/sbin# cat /etc/ppp/resolv.conf >> /etc/resolv.conf
root@box:/usr/local/sbin# ping www.google.com
PING www.google.com (216.58.198.164): 56 data bytes
64 bytes from 216.58.198.164: seq=0 ttl=47 time=457.765 ms
64 bytes from 216.58.198.164: seq=1 ttl=47 time=497.296 ms
64 bytes from 216.58.198.164: seq=2 ttl=47 time=546.804 ms
64 bytes from 216.58.198.164: seq=3 ttl=47 time=496.270 ms
-
Thanks, that looks great. I will give it a go again. It will be mid week before I find any time.
Given ZTE's situation I am concerned about long term availability of the device I am using, so a backup plan would be very useful.
-
Also, forgot to mention that the plog script (which just filters the syslog for ppp related entries and displays them) wants to read from /var/log/syslog - which doesn't exist. Add the syslog bootcode to cmdline.txt which gives you /var/log/messages and then symlink /var/log/syslog to /var/log/messages.
I assume that enabling syslog in an a system running entirely from RAM is not a great idea in case the file grows too big? Do people generally just leave it off unless needed for troubleshooting or logging to an external syslog server?
-
So I made one big tcz tonight which is around 13MB. It contains everything for ppp, hostapd, wifi, curl, and w1. I saved all the /etc/ppp config stuff amongst other things in a mydata.tgz instead of including it in the tcz itself, for obvious reasons.
Not done yet, but this project which has been at least 4 years in the making, will be to report ambient temperature of our travel trailer while we are out and about and leaving the dog behind. I think the logic will be, connect to wifi if available, cron job will send temperature using curl via email to sms address to my cell phone. If wifi isn't available, then use cellular modem. If neither is available, start hostapd for troubleshooting.
All the pieces are tested, just need to glue it all together.
-
Tim, if this makes your testing easier, here are links to the ppp.tgz and ppp_scripts.tgz noted in my write up:
https://www.strongspace.com/shared/iwrh2r6p99
https://www.strongspace.com/shared/0pwpaa4uig
-
Thanks for your help. I now have the Huawei E173 working.
I will outline the additional steps I had to take in case it proves useful to someone in the future.
I had to use usb_modeswitch to switch my E173 from storage mode to modem mode. So I downloaded and built it. This command puts it i the correct mode.
sudo usb_modeswitch -v 0x12d1 -p 0x1446 -V 0x12d1 -P 0x140c -m 0x01 -M "55534243123456780000000000000011060000000000000000000000000000"
I have downloaded your files, and followed your instructions, setup the scripts for my carrier Vodafone UK ie set user and password to "wap" in mobile-auth and changed the link. Setup an apn file with
AT+CGDCONT=1,"IP","pp.vodafone.co.uk"
and changed the link.
pon then appeared to bring up the link, but I was unable to ping 8.8.8.8. the default route was clearly not setup so
sudo route del default
sudo route add default gw 10.64.64.64
sudo cp /etc/ppp/resolv.conf /etc/resolv.conf
And all is working.
Now to tidy up make it available on reboot and easily scriptable.
I will need a quantity of adapters and the ZTE one although easy to setup and use is becoming difficult to purchase (only via ebay) so I will next try the currently available Huawei E3531 that I hope will work in the same way as the E173.
Tim
-
Great news Tim that you got it working. I should have mentioned that I had already switched my E173 to modem mode shortly after I got it a few years ago. See this link for a couple of points:
https://robpol86.com/raspberry_pi_project_fi.html
I believe I used the "Permanent Modem Mode" section of that page but I just used putty on my Windows laptop.
If you're looking at Huawei modems, see the "NDISDUP" section on that page also. I tried to get that working with the E173 without success. I will say that I was able to get a wwan0 device as shown in the notes below, but never able to get it connected.
tc@box:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 12d1:14fe
Installed the device driver that came on the modem stick on windows and then used putty at 115200 to connect to com5 and changed mode iaw:
https://github.com/Robpol86/robpol86.com/blob/master/docs/raspberry_pi_project_fi.rst
Basically, just:
AT^SETPORT="FF;1,2,3,7"
Then pull and reinsert and the mass storage device mode is disabled.
Reinstall in pi and now it's:
tc@box:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 12d1:1506
Install usb-serial-4.9.22-piCore extension
dmesg shows:
[ 685.342126] usbcore: registered new interface driver usbserial
[ 685.342376] usbcore: registered new interface driver usbserial_generic
[ 685.375466] usbserial: USB Serial support registered for generic
[ 685.421384] usbcore: registered new interface driver option
[ 685.421528] usbserial: USB Serial support registered for GSM modem (1-port)
[ 685.421899] option 1-1:1.0: GSM modem (1-port) converter detected
[ 685.429907] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 685.430179] option 1-1:1.1: GSM modem (1-port) converter detected
[ 685.432481] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 685.432749] option 1-1:1.2: GSM modem (1-port) converter detected
[ 685.436271] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
2581075724 >
tc@box:~$ ls -alh /lib/modules/4.9.22-piCore/kernel/drivers/net/usb/
total 148
drwxr-xr-x 2 root root 160 Jan 1 1970 ./
drwxr-xr-x 5 root root 240 Jan 1 1970 ../
-rw-r--r-- 1 root root 9.0K Jun 20 11:56 cdc_eem.ko
-rw-r--r-- 1 root root 15.6K Jun 20 11:56 cdc_ether.ko
-rw-r--r-- 1 root root 14.0K Jun 20 11:56 cdc_mbim.ko
-rw-r--r-- 1 root root 34.6K Jun 20 11:56 cdc_ncm.ko
-rw-r--r-- 1 root root 8.5K Jun 20 11:56 cdc_subset.ko
-rw-r--r-- 1 root root 54.4K Jun 20 11:56 hso.ko
This worked to get wwan0 device finally!:
echo "12d1 1506" > /sys/bus/usb/drivers/qmi_wwan/new_id
had to have qmi_wwan module loaded
cat /sys/kernel/debug/usb/devices