Advertisement
josephxsxn

Pi0W Headless Notes

Jun 24th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.97 KB | None | 0 0
  1. #Auto Join WiFi
  2. Edit /etc/wpa_supplicant/wpa_supplicant.conf adding
  3. ```
  4. network={
  5.    ssid="YourNetworkSSID"
  6.    psk="Your Network's Passphrase"
  7.    key_mgmt=WPA-PSK
  8. }
  9. ```
  10.  
  11. #ReEnable SSH By Default
  12. Drop 'ssh' file into /boot/  the file is not required to have content
  13.  
  14. ###
  15. #Setup 4G Dongle
  16. #lsusb
  17. Bus 001 Device 004: ID 12d1:1505 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
  18.  
  19. tar -xzvf /usr/share/usb_modeswitch/configPack.tar.gz 12d1\:1505
  20.  vi 12d1\:1505
  21. # Huawei EC156, Huawei E372u-8
  22. TargetVendor=0x12d1
  23. TargetProductList="140b,140c,1506,150f,150a"
  24. HuaweiNewMode=1
  25.  
  26. sudo vi /etc/usb_modeswitch.d/12d1\:1505
  27. DefaultVendor= 0x12d1
  28. DefaultProduct=0x1505
  29. TargetVendor=  0x12d1
  30. TargetProductList="140b,1506,150f"
  31. MessageContent="55534243123456780000000000000011062000000100000000000000000000"
  32.  
  33. sudo usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:1505
  34. sudo reboot
  35. sudo qmi-network /dev/cdc-wdm0 start
  36.  
  37.  
  38. #At each reboot use
  39. sudo qmi-network /dev/cdc-wdm0 start
  40.  
  41. #Wait up to 1 minute for the IP to resolve.
  42.  
  43. #########
  44. ###IGNORE BELOW THIS
  45. #########
  46.  
  47. cat /etc/wvdial.conf
  48. [Dialer Defaults]
  49. Init1 = ATZ
  50. Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
  51. Init3 = AT+CGDCONT=1,"IP","h2g2"
  52. Modem Type = Analog Modem
  53. Baud = 460800
  54. New PPPD = yes
  55. Modem = /dev/ttyUSB0
  56. ISDN = 0
  57. Phone = *99#
  58. Password = { }
  59. Username = { }
  60. Stupid Mode = 1
  61.  
  62. #https://guyrobottv.wordpress.com/2015/05/01/using-raspberry-pi-as-a-carputer-and-wifi-4g-hotspot/
  63.  
  64. #Add to -> /etc/usb_modeswitch.conf
  65. ##LTE 4G
  66. DefaultVendor=0x12d1
  67. DefaultProduct=0x1505
  68. MessageEndpoint="0x01"
  69. MessageContent="55534243123456780000000000000011062000000101000100000000000000"
  70.  
  71. #then
  72. sudo usb_modeswitch -c /etc/usb_modeswitch.conf
  73.  
  74. #ifconfig and wwan0
  75. #apt-get install libqmi-utils
  76. #echo "APN=h2g2" >/etc/qmi-network.conf
  77.  
  78. qmicli -d /dev/cdc-wdm0 --wds-start-network=h2g2 --client-no-release-cid --wds-follow-network
  79.  
  80. http://garethhowell.com/wp/connect-raspberry-pi-3g-network/
  81.  
  82.  
  83. ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement