Huawei E3331 is not detected as modem (to send sms) - raspberry-pi

$ lsusb
Bus 001 Device 014: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
$ gammu-detect
; Configuration file generated by gammu-detect.
; Please check The Gammu Manual for more information.
[gammu]
device = /dev/ttyS2
name = Phone on serial port 2
connection = at
The modem is detected as mass storage. I want the modem to be detected as Modem/Networkcard

I have searched and tried and finally this worked for me
Solution 1:
- /etc/mode_switch.config and turn on the following flag:
DisableSwitching=1
Go to following folder and create the 12d1:14fe file
$ cd /etc/usb_modeswitch.d/
$ sudo tar -xzvf /usr/share/usb_modeswitch/configPack.tar.gz 12d1:14fe
Edit 12d1:14fe file and add following lines and save it
DefaultVendor=0x12d1
DefaultProduct=0x14fe
TargetVendor=0x12d1
TargetProduct=0x1506
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
If you remove the USB dongle and reconnect it. You have to run following command to bring it back in modem mode
sudo usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:14fe
To auto detect the USB dongle as modem when it is connected then set following rule
sudo touch /etc/udev/rules.d/huawei_e3331.rules
Then create add following rules to file and save it
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14fe", RUN+="/usr/sbin/usb_modeswitch -v 0x12d1 -p 0x14fe -V 0x12d1 -P 0x1506 -M '55534243123456780000000000000011062000000100000000000000000000'"
$ gammu-detect > .gammurc
$ sudo gammu-detect > .gammurc
$ gammu identify
Device : /dev/ttyUSB0
Manufacturer : Huawei
Model : unknown (E3331)
Firmware : 21.146.07.01.158
IMEI : 869************
SIM IMSI : 412************
$ echo "test" | sudo gammu sendsms TEXT 070*******
you will receive a test message

First of all, make sure that your mobile card has 3G permission, that is, 186 mobile phone number, and other 2G mobile phone numbers can also have 3G permission;
Anyway, it is the Unicom card of Waupaca brand;
Second, isn't there a PC Suite in the software of connecting the mobile phone to the computer? In the middle of the software installation, you will be asked if you want to install the driver, which must be confirmed. After that, if you uninstall the software, you can version it, but you can't uninstall the driver;
Connect the phone cable to the USB port of the computer. There will be an Android adapter in the computer manager, which means the driver is installed;
When the mobile phone is connected to the computer, it can't turn on the U-disk mode;
Run daily up for Android on the computer... Just click Connect right
It takes a lot of traffic

Related

how can i reset service usb to serial driver that listed in lsmod without reboot system?

I have one usb_to_serial that connected my usb
and installed by this command
modprobe usbserial vendor=0x67b product=0x2303
and connect to other devices via console
and when use of the screen for connecting to console for example
screen /dev/ttyUSB0 9600
i can stop the session by the this command
fuser -k /dev/ttyUSB0
but when connect to other device console my console empty show
my question is when i reboot the system and connecting the first device via Console any thing is ok but when i need to connect to other device then must be reboot the os thus can to connect new device! there is any method that don`t required to reboot and only reset the usbserial service without reboot?
thanks for help
now me found a method to restart service usbconsole
if you have same problem then can to try kill process by
pkill -f /dev/ttyUSB0 ; screen /dev/ttyUSB0 9600
by this command you kill prior session on Serial Console and create new session for them

Cannot connect to Coral Dev Board (Edge TPU)

While following the instructions on Get Started with Edge TPU Dev Board, I can't get past Step 2:
$ screen /dev/ttyUSB0 115200
The issue is that screen immediately returns
[screen is terminating]
I have verified the contents of /etc/udev/rules.d/65-edgetpu-board.rules, verified the dmesg output, tried different USB ports, verified that all screen instances are closed, etc.
Solution = run screen command with sudo:
$ sudo screen /dev/ttyUSB0 115200
First you should flash your iptables
Coammands:
sudo iptables -F
mdt devices

Read Battery Percentage of iPhone via WLAN

I found an app that shows the battery percentage of my iPhone in the menu bar (iBetterCharge). The iPhone is not connected via USB or Bluetooth (it is only connected to the same network as my Macbook).
My question is: How can I get this information? The device shows up in IOReg, but only because I connected my phone via Bluetooth once.
This can be done by using the unix application "libimobiledevice". I'm not sure that it works with all versions of iOS.
//install it:
brew install libimobiledevice
//list all device
idevice_id --list // list available device UDIDs. Normally, we have to plug the device at least once to get its UUID.
//get the current syslog of device that we want to check
idevicesyslog -u <device udid>
//do some text search to get the battery info
//or running ideviceinfo (I don't know if it works wirelessly)
//run 'ideviceinfo --help' to see how it works
ideviceinfo -u <device udid> --domain com.apple.mobile.battery
More read at:
https://www.theiphonewiki.com/wiki/MobileDevice_Library

Pi 3 + Microstack GPS communication

I bought a Raspberry Pi 3 Model B, a microstack baseboard and a microstack GPS.
I followed the instructions written in the official documentation but I can't connect to the GPS.
Basically, the GPS led flashes so it means it has find a gps fix, but I can't see any data from the PI.
For example, if I try
cat /dev/ttyAMA0
I get always nothing. I already used raspi-config to disable kernel serial and to enable i2c and spi.
Also if I try
stty -F /dev/ttyAMA0 ispeed 4800 && cat </dev/ttyAMA0"
I get an error.
Anyone has any advice, please?
Or maybe these modules are not compatible with Pi 3?
Thanks a lot!
It's hard telling what has been done, or not done. The 'official' documentation from Microstack provides two methods of setting up the serial port. It then continues with
Automatically Starting gpsd
To automatically start the gps service when the Raspberry Pi® boots, re­configure the GPS
daemon by typing into a terminal
sudo dpkg-­reconfigure gpsd
● Choose <yes> when asked if you want to start gpsd automatically.
● Choose <no> when asked “should gpsd handle attached USB GPS
receivers automatically” .
● When asked which “Device the GPS receiver is attached to” , enter
/dev/ttyAMA0 .
● Accept the defaults for other options.
If you have configured your serial port as per instructions and configured gpsd to automagically start and pick up the device you have just setup, ...then, since the gpsd is handling the device (right?), the device will be busy and the command cat /dev/ttyAMA0 should return cat: /dev/ttyAMA0: Device or resource busy...but, it did not.
Either the serial is not configured as per instructions, or the gpsd is not running and picking up the device, or both.
The goal is not to cat your gps data, but the cat not returning an error indicates something is amiss.
Typically, it's just a typo. But it can be from skipping a step in the process, or mixing instructions from various sources so that the left hand doesn't know what the right hand has done.
Try:
sudo killall gpsd if it returns gpsd: no process found that answers one question.
If it returns with no error, follow it up with cat /dev/ttyAMA0. If it returns nothing, the direction you should look is your serial port configuration.
If sudo dpkg-reconfigure gpsd is not allowing you to reconfigure (I thought it was just me) you can modify the configuration of gpsd by using your favourite editor, e.g. sudo nano /etc/default/gpsd and entering something like:
# Default settings for the gpsd init script and the hotplug wrapper.
# Start the gpsd daemon automatically at boot time
START_DAEMON="true"
# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="false"
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyAMA0"
# Other options you want to pass to gpsd
GPSD_OPTIONS="-n -G"
You may find the -n and -G useful. Save and restart.
I finally found a solution:
On the Pi 3, there are more steps to use serial, you have to disable the BT.
Edit config file:
sudo nano /boot/config.txt
Add this at the bottom:
dtoverlay=pi3-disable-bt-overlay
Then run this:
sudo systemctl disable hciuart
This article was very usefull for me
http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/#comment-67160
and i recommand you to read it
Now on RPI3 the Serial port
ttyAMA0 is used by BlueTooth
ttySO refers to the GPIO
The Alias Serial0 refers to the GPIO both on RPI2 and RPI3.
So :
after a reinstallation of Jessie with a recent version to be sure all is clean
as usual
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo raspi-config
go to Advanced options : Would you like a login shell to be accessible over serial? response "yes" (not as in the microstack datasheet )
$ sudo apt-­get install python3-­microstacknode
To install the gpsd standard tools
$ sudo apt­-get install gpsd gpsd-­clients python­-gps
edit GPSD by
$ sudo nano /etc/default/gpsd
and put the options :
START_DAEMON="true"
USBAUTO="false"
DEVICES="/dev/serial0"
GPSD_OPTIONS="-n -G"
equally
$ sudo nano /boot/cmdline.txt
remove
console=serial0,115200
and save
$ sudo nano /boot/config.txt
you must have at the end
enable_uart=1
Disable the console by
$ sudo systemctl stop serial-getty#ttyS0.service
$ sudo systemctl disable serial-getty#ttyS0.service
i have equally done $ sudo chmod 775 ../../dev/ttySO ( i dont know if it is really necessary )
and obviously a reboot
and miracle the gps works with
cgps -s
NB: you must have a fix on the GPS ( the red led flashes )
jpherrenknecht

Wireshark. How to route traffic from iPhone

I'm trying to capture packets from my iPhone app. It does not use HTTP to communicate, but a custom protocol to connect with my server. I can not use Paros to monitor the packets sent.
Is it possible to proxy the date through wireshark just like you can with Paros for http?
You can't proxy the data through Wireshark, per se; the problem is to have Wireshark running somewhere where it can see the traffic passing by. (If you had command line only, you could run tcpdump and capture packets, and then load the dump file into Wireshark somewhere else that had a UI.)
Are you on a Mac? If so, plug your mac into ethernet so that it has an internet connection (or connection to your server, anyway). Then share your Mac's internet connection over its wifi. Connect to this wifi point using your iPhone. Run Wireshark on the Mac (promiscuous mode enabled), then use your iPhone app and watch Wireshark. No need to mess around with servers or forwarding X11 connections! You could do something very similar with a Windows PC too.
The best solution that works:
Connect your device thru USB and type these commands:
rvictl -s UDID (UDID = id of device, 32 chars, you can locate it in iTunes or 'Devices & Simulators' in Xcode)
sudo launchctl list com.apple.rpmuxd
sudo tcpdump -n -t -i rvi0 -q tcp
OR just sudo tcpdump -i rvi0 -n
If rvictl is not working install Xcode (or see -bash : rvictl: command not found, Mac book pro OS X 10.7.5 & Xcode 4.6)
For more info:
Remote Virtual Interface
http://useyourloaf.com/blog/2012/02/07/remote-packet-capture-for-ios-devices.html
Run wireshark on the server - you'll see the traffic there.