From: Alejandro Benete Date: Wed, 31 Mar 2021 09:26:49 +0000 (+0200) Subject: meta-somdevices: ppp: Modified reset_modem to toggle the power pin (hard reset) inste... X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=60cb00a9434bd8253b01ec56ad4ff1b121e2e620;p=meta-somdevices.git meta-somdevices: ppp: Modified reset_modem to toggle the power pin (hard reset) instead of sending AT^RESET. Signed-off-by: Alejandro Benete --- diff --git a/recipes-connectivity/ppp/ppp/reset_modem.py b/recipes-connectivity/ppp/ppp/reset_modem.py deleted file mode 100755 index 054f6d5..0000000 --- a/recipes-connectivity/ppp/ppp/reset_modem.py +++ /dev/null @@ -1,10 +0,0 @@ -import serial - -ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=5) -for i in range(5): - ser.write('AT^RESET\r') - response = 'init' - while (response != '') and ('OK' not in response): - response = ser.readline() - if 'OK' in response: - break \ No newline at end of file diff --git a/recipes-connectivity/ppp/ppp/reset_modem.sh b/recipes-connectivity/ppp/ppp/reset_modem.sh index e3d8799..1766dba 100755 --- a/recipes-connectivity/ppp/ppp/reset_modem.sh +++ b/recipes-connectivity/ppp/ppp/reset_modem.sh @@ -1,4 +1,5 @@ #!/bin/bash -/usr/bin/python /etc/ppp/reset_modem.py -sleep 15 -/etc/ppp/wait-dialup-hardware 20 \ No newline at end of file +/bin/echo 0 > /sys/class/leds/usb_otg2_vbus/brightness +/bin/sleep 2 +/bin/echo 1 > /sys/class/leds/usb_otg2_vbus/brightness +/etc/ppp/wait-dialup-hardware 20 diff --git a/recipes-connectivity/ppp/ppp_2.4.7.bbappend b/recipes-connectivity/ppp/ppp_2.4.7.bbappend index 57ec9b0..6c37c12 100644 --- a/recipes-connectivity/ppp/ppp_2.4.7.bbappend +++ b/recipes-connectivity/ppp/ppp_2.4.7.bbappend @@ -30,7 +30,6 @@ SRC_URI += " \ file://options \ file://provider \ file://reset_modem.sh \ - file://reset_modem.py \ file://resolv.conf \ file://wait-dialup-hardware \ " @@ -68,7 +67,6 @@ do_install_append () { install -m 0664 ${WORKDIR}/options-mobile.base ${D}${sysconfdir}/ppp/options-mobile.base install -m 0664 ${WORKDIR}/options-mobile ${D}${sysconfdir}/ppp/options install -m 0775 ${WORKDIR}/reset_modem.sh ${D}${sysconfdir}/ppp/reset_modem.sh - install -m 0775 ${WORKDIR}/reset_modem.py ${D}${sysconfdir}/ppp/reset_modem.py install -m 0664 ${WORKDIR}/resolv.conf ${D}${sysconfdir}/ppp/resolv.conf install -m 0775 ${WORKDIR}/wait-dialup-hardware ${D}${sysconfdir}/ppp/wait-dialup-hardware ln -s -r ${D}${sysconfdir}/ppp/options-mobile.base ${D}${sysconfdir}/ppp/options-mobile