|
Post by lbrutti on Dec 10, 2017 5:35:03 GMT -8
Hello support I built a fork of GroveWeather PI with some additional sensors and umts connectivity and I'm having an issue connecting to the internet with sakig3g when the usb modem is plugged through the USB Power Control: Sakis 3g connects with now problem when USB Dongle is connected directly to rpi. In order to reboot the modem I do the following steps: - Init:
#UMTS key USB power management UMTS_POWER_CONTROL_ENABLE_PIN = 6 UMTS_POWER_CONTROL_CONTROL_PIN = 12
#turn off UMTS key GPIO.setup(UMTS_POWER_CONTROL_ENABLE_PIN, GPIO.OUT, initial=True) GPIO.setup(UMTS_POWER_CONTROL_CONTROL_PIN, GPIO.OUT, initial=False)
- Power On Dongle:
GPIO.output(UMTS_POWER_CONTROL_CONTROL_PIN, True)
- Reset USB bus to reboot dongle:
subprocess.call(['sudo','bash',"../bash/resetUsb.sh"])
../bash/resetUsb.sh contents:
# Raspberry Pi 1 running Raspbian Wheezy FILE=/sys/devices/platform/bcm2708_usb/buspower if [ ! -e $FILE ]; then # Raspberry Pi 2 running Raspbian Jessie FILE=/sys/devices/platform/soc/3f980000.usb/buspower fi if [ ! -e $FILE ]; then # Raspberry Pi 1 running Raspbian Jessie FILE=/sys/devices/platform/soc/20980000.usb/buspower fi if [ -e $FILE ]; then echo "Power-cycling USB to fix dead stick" sleep 0.1 echo 0 > $FILE sleep 1 echo 1 > $FILE sleep 2 else echo "Could not find a known USB power control device. Checking /sys/devices/platform/:" find /sys/devices/platform/* | grep buspower fi - Call Sakis Connect:
subprocess.call(['sudo','bash',"../bash/sakisConnect.sh"]) content of sakisConnect.sh:
#!/bin/bash cd /home/unive/umtskeeper sudo ./sakis3g --console --pppd connect APN="MY_ACTUAL_APN" USBDRIVER="option" USBMODEM="12d1:1506" OTHER="USBMODEM" MODEM="OTHER"
Calling steps 3 and 4 from python when USB Dongle is directly plugged to RPI ends up in correct connection, when there's the USB Power Control Board it doesn't.
By comparing sakis logs it seems like that AT commands do not reach the dongle:
|
|
|
Post by SDL on Dec 10, 2017 10:40:15 GMT -8
Hello Ibrutti,
Ok First thing. 1) Does the light on the USB PowerControl board showing the USB Power On light up and turn off appropriately?
Depending on the answer to #1 above, there might be some kind of timing issue here.
If you don't reset the USB Bus (just power it on normally using the GPIO pins on USB PowerControl) can you access the Dongle?
We extensive use this mode of controlling a dongle in Project Curacao2 and it works like a champ. In our case we power it off at 10 minutes after the hour and power it up at 5 minutes to the hour to ave power.
BP
|
|
|
Post by lbrutti on Dec 21, 2017 15:52:39 GMT -8
Hello SDL, thanks for the reply.
"1) Does the light on the USB PowerControl board showing the USB Power On light up and turn off appropriately?"
Yes, i also tested the board by plugging in an USB LED lamp and it turns on and off regularly.
"If you don't reset the USB Bus (just power it on normally using the GPIO pins on USB PowerControl) can you access the Dongle?" No, it doesn't show up in lsusb...
For the moment i bypassed the board completely and i'll keep an eye on energy consumption...
|
|
|
Post by jerkeife on Aug 1, 2018 11:15:57 GMT -8
Hello SDL, thanks for the reply. "1) Does the light on the USB PowerControl board showing the USB Power On light up and turn off appropriately?" Yes, i also tested the board by plugging in an USB LED lamp and it turns on and off regularly. "If you don't reset the USB Bus (just power it on normally using the GPIO pins on USB PowerControl) can you access the Dongle?" No, it doesn't show up in lsusb... For the moment i bypassed the board completely and i'll keep an eye on energy consumption... Any luck with figuring this issue out? My modem is mimicking what you saw but intermittently it will show up in lsusb and connect.
|
|
|
Post by SDL on Aug 2, 2018 4:48:18 GMT -8
I would ask you the same questions:
Ok First thing. 1) Does the light on the USB PowerControl board showing the USB Power On light up and turn off appropriately?
Depending on the answer to #1 above, there might be some kind of timing issue here.
If you don't reset the USB Bus (just power it on normally using the GPIO pins on USB PowerControl) can you access the Dongle?
We extensive use this mode of controlling a dongle in Project Curacao2 and it works like a champ. In our case we power it off at 10 minutes after the hour and power it up at 5 minutes to the hour to ave power.
BP
|
|
|
Post by jerkeife on Aug 2, 2018 5:26:06 GMT -8
I would ask you the same questions: Ok First thing. 1) Does the light on the USB PowerControl board showing the USB Power On light up and turn off appropriately? Depending on the answer to #1 above, there might be some kind of timing issue here. If you don't reset the USB Bus (just power it on normally using the GPIO pins on USB PowerControl) can you access the Dongle? We extensive use this mode of controlling a dongle in Project Curacao2 and it works like a champ. In our case we power it off at 10 minutes after the hour and power it up at 5 minutes to the hour to ave power. BP 1. It does power up and I can control the on/off and enable pins without issue. It appears that my issue could be with my Pi/the power draw from the Pi. I wrote a script that controls only the USB Power Control and everything worked as expected. However when I initialize (not just connect but initialize in a python script) a camera, the modem will no longer connect. The built in lights on the modem indicate that the modem never gets past booting up. It will get to a certain point and it resets, almost like the current drops and the modem turns off and then back on. With the camera initialized and the modem plugged directly into the Pi, everything works as expected. I have set the max_usb_current = 1 to max out the current available at the USB ports. If this is moving too far from the original thread concern, feel free to move it to a new thread.
|
|
|
Post by SDL on Aug 2, 2018 8:06:17 GMT -8
Now that is interesting. I wonder if it is pulling so much current that the power switch we are using on the board is being overwhelmed. I don't have the spec in front of me, but I think the limit is around 2 Amps. Which is a lot for a USB port.
If you are handy, put a 1000 uF capacitor on the 5V USB Out Pins: JP2 - Power Utility Pins
I believe that would supply enough burst current to make everything work.
BP
|
|
|
Post by jerkeife on Aug 2, 2018 8:19:59 GMT -8
Now that is interesting. I wonder if it is pulling so much current that the power switch we are using on the board is being overwhelmed. I don't have the spec in front of me, but I think the limit is around 2 Amps. Which is a lot for a USB port. If you are handy, put a 1000 uF capacitor on the 5V USB Out Pins: JP2 - Power Utility Pins I believe that would supply enough burst current to make everything work. BP Just to be clear: JP2 5Vout --------->1000 uF--------->USB 5V out
|
|
|
Post by jerkeife on Aug 2, 2018 9:09:19 GMT -8
Now that is interesting. I wonder if it is pulling so much current that the power switch we are using on the board is being overwhelmed. I don't have the spec in front of me, but I think the limit is around 2 Amps. Which is a lot for a USB port. If you are handy, put a 1000 uF capacitor on the 5V USB Out Pins: JP2 - Power Utility Pins I believe that would supply enough burst current to make everything work. BP Just to be clear: JP2 5Vout --------->1000 uF--------->USB 5V out Or put a 1000 uF between J2/1 and J2/2?
|
|
|
Post by jerkeife on Aug 3, 2018 8:35:19 GMT -8
Just to be clear: JP2 5Vout --------->1000 uF--------->USB 5V out Or put a 1000 uF between J2/1 and J2/2? You can ignore the last two posts. I tested the setup using a different Pi and the board worked as expected. Thanks for your help.
|
|
|
Post by SDL on Aug 4, 2018 4:18:37 GMT -8
Great! Was it a different type of Pi?
The capacitor would go across J2/1 and J2/2.
BP
|
|
|
Post by jerkeife on Aug 4, 2018 4:32:14 GMT -8
Great! Was it a different type of Pi? The capacitor would go across J2/1 and J2/2. BP The Pi that was not working was Pi 2 model B. The pi that works is a pi zero. I did attempt the capacitor across J2 for fun and when the model b would turn the USB power on, the pi would reboot. I am guessing this is some current overflow protection.
|
|
|
Post by SDL on Aug 4, 2018 4:39:50 GMT -8
Assuming that you had the capacitor correctly polarized, I think you are correct.
Reducing the capacitor value to say, 100uf is probably the next thing to try.
BP
|
|