We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

network state > mce ?

asked 2015-10-31 11:30:39 +0200

Robomike gravatar image

Back in middle 2014, when my Jolla as one of many had the "spontaneous shutdown problem", I tuned the /etc/mce/20hybris-led.ini with PatternDeviceOn=254;0;0;50;3000;0000ff, to show me an economical "still alive" blink. Works great and I would rather not give up that. This time the use of my Jolla is a bit harder, and sometimes it falls out of my pocket and loses contact to the sim-card. The blue "still alive" is active, but there's no connection anymore, because I have to enter the pin first.

Is anyone able to give me some ideas how to turn blue to red in this case? Somewhere in the system must be the information about connection state, and somehow it's possible to create own notifications with appropriate patterns. I would like to link one to the other, but have less knowledge. Some productive links to helpful documentations for both sides or an idea for a basic solution would be appreciated.

Thanks, Michael

edit retag flag offensive close delete

Comments

1

You can find the state in /run/state/namespaces/Cellular/Status holds "registered" if all is ok. Have no idea yet on how to change the led color, other than replacing /etc/mce/20hybris-led.ini and restarting mce. Should be possible somehow, even from systemd. But don't have the answer right now.

filipb92 ( 2015-10-31 12:42:23 +0200 )edit

Thank you, that's a useful hint!

And for the other side - I know that the great Coderus once used an own somethinghybris-led.ini, so it's just a question where to start reading the documentation. I'll post it here when I've learnt more.

Robomike ( 2015-11-01 18:52:32 +0200 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2015-11-03 13:23:19 +0200

spiiroin gravatar image

A very rough outline on how something like you want can be implemented

1) Define a new led pattern for the purpose.

Assuming would want it to a) have higher priority than the sms/email/etc notifications and DeviceOn pattern, b) show up regardless of the display state c) have non-blinking blue color - something like this:

[root@Jolla ~]# cat /etc/mce/90-no-cellular-led.ini 
[LEDPatternHybris]
PatternNoCellularConnection=24;5;0;0;0;0000ff

(Note that after installing/removing such files mce needs to be restarted for the changes to take effect)

2) Have something track cellular connectivity status and activate/deactivate the led pattern based on that

Most likely it needs to be always running daemon to be useful.

The led can be controlled using equivalents of these D-Bus method calls:

[nemo@Jolla ~]$ dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:PatternNoCellularConnection
[nemo@Jolla ~]$ dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:PatternNoCellularConnection
edit flag offensive delete publish link more

Comments

Thanks a lot! That's the missing information. Didn't know that the *led.ini is registered automatically there, and had no idea how to activate the patterns. I will try out!

Robomike ( 2015-11-03 23:35:45 +0200 )edit
0

answered 2015-10-31 12:43:30 +0200

Direc gravatar image

Try this line:

PatternDeviceOn=254;0;0;50;3000;ff0000
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2015-10-31 11:30:39 +0200

Seen: 416 times

Last updated: Nov 03 '15