Skip to content

Instantly share code, notes, and snippets.

@lduboeuf
Last active March 10, 2023 13:07
Show Gist options
  • Save lduboeuf/9189776d34e10ce971eaf609ddb6687b to your computer and use it in GitHub Desktop.
Save lduboeuf/9189776d34e10ce971eaf609ddb6687b to your computer and use it in GitHub Desktop.
install `ofono-phonesim`
uncomment in `/etc/ofono/phonesim.conf`:
[phonesim]
Address=127.0.0.1
Port=12345
-->restart phone
#launch phonesim app: ( you should see a black background with activity indicator )
[Xenial]
DESKTOP_FILE_HINT=unity8.desktop ofono-phonesim -p 12345 -gui /usr/share/phonesim/default.xml &
[Focal]
QT_IM_MODULE=maliitphablet DESKTOP_FILE_HINT=lomiri.desktop ofono-phonesim -p 12345 -gui /usr/share/phonesim/default.xml &
--> enter
#enable phonesim modem:
/usr/share/ofono/scripts/enable-modem /phonesim
--> GUI should be displayed, change orientation to make it more readable
#Register /phonesim as the main SIM card so that telepathy-ofono can deal with it
# adapt "ofono/ofono/ril_0" with the one of available accounts `mc-tools list` ( Focal >= H9 ofono/ofono/ril_0 )
mc-tool update ofono/ofono/ril_0 string:modem-objpath=/phonesim
mc-tool reconnect ofono/ofono/ril_0
--> in tab "CBM"
write text
channel (in hexa) should be changed each time or "Update Number" should be increased each time (hexa) ( ofono does not allow to replay the same CBM )
example: Presidentical channel (4370): hexa = 1112
"channels" subscription can be made with:
Get properties: dbus-send --system --print-reply --dest=org.ofono /phonesim org.ofono.CellBroadcast.GetProperties
Set Topics: dbus-send --system --print-reply --dest=org.ofono /phonesim org.ofono.CellBroadcast.SetProperty string:'Topics' variant:string:'4371-4380,4396'
Listen to ouputs from Ofono:
sudo dbus-monitor --system "type='signal',sender='org.ofono'"
Back to default:
kill background process ( fg , ctrl + c )
mc-tool update ofono/ofono/ril_0 string:modem-objpath=/ril_0
mc-tool reconnect ofono/ofono/ril_0
@lduboeuf
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment