Launching ofono with SIM800

From ZeroPhone
Jump to: navigation, search

Compiling ofono in Raspbian

git clone git://git.kernel.org/pub/scm/network/ofono/ofono.git
cd ofono
apt install automake build-essential libtool libglib-2.0-dev libglib-2.0 libglib2.0-dev libdbus-1-dev libudev-dev mobile-broadband-provider-info
# remove -Wno-error-cast=align and ‘-Wno-format-truncation’ from makefile
./bootstrap-configure
make

Adding an udev rule to point to the modem's UART

echo "KERNEL==\"ttyAMA0\", ENV{OFONO_DRIVER}=\"sim900\""| sudo tee /etc/udev/rules.d/00-ofono.rules

Starting ofonod in debug mode

./src/ofonod -n -d 'plugins/*'
[...]
ofonod[5102]: plugins/udevng.c:add_serial_device() Device is missing required OFONO_DRIVER property
ofonod[5102]: plugins/udevng.c:create_modem() /sys/devices/platform/soc/20201000.serial/tty/ttyAMA0
ofonod[5102]: plugins/udevng.c:create_modem() driver=sim900
ofonod[5102]: plugins/sim900.c:sim900_probe() 0x1fba88
ofonod[5102]: plugins/dun_gw_bluez5.c:modem_watch() modem: 0x1fba88, added: 1
ofonod[5102]: plugins/hfp_ag_bluez5.c:modem_watch() modem: 0x1fba88, added: 1
ofonod[5102]: plugins/smart-messaging.c:modem_watch() modem: 0x1fba88, added: 1
ofonod[5102]: plugins/push-notification.c:modem_watch() modem: 0x1fba88, added: 1
ofonod[5102]: plugins/hfp_hf_bluez5.c:connect_handler() Registering External Profile handler ...
ofonod[5102]: plugins/bluez5.c:bt_register_profile() Bluetooth: Registering 0000111e-0000-1000-8000-00805f9b34fb (hfp_hf) profile
ofonod[5102]: plugins/bluez5.c:profile_register_cb()

Listing detected modems

python2 ./list-modems 
[ /sim900_0 ]
    Features = 
    Emergency = 0
    Powered = 0
    Lockdown = 0
    Interfaces = 
    Online = 0
    Type = hardware

[ /stktest ]
    Features = 
    Emergency = 0
    Powered = 0
    Lockdown = 0
    Interfaces = 
    Online = 0
    Type = test