Feature #1201
openAdd Pairing apps to launcher in imrest
Added by Hammel about 1 month ago. Updated about 18 hours ago.
90%
Description
The launcher should allow enabling of pairing devices on Ironman. This would allow removal of the GPIO hardware hack.
The pairing feature needs to be dynamically loaded into the status bar and a touch on it's icon sends an IPC message to imrest to enable pairing.
Related issues
Updated by Hammel about 1 month ago
- Blocked by Feature #1202: Add support for dynamically loading features. added
Updated by Hammel 28 days ago
- Subject changed from Add Pairing feature as an add-on to launcher to Add Pairing apps to launcher in imrest
- Severity changed from 02 - High to 01 - Critical
imrest needs a simple app (binary or script) that is run via the launcher's status bar to toggle pairing mode.
The app will contact imrest via a UNIX_DOMAIN socket. The contact will enough to toggle the current state.The app will then need to update the status bar icon. This will need to be done by one of the following methods.
- Change a symlink between active and inactive icon for pairing
- Change app config by notifying launcher via a UNIX_DOMAIN socket to swap the active icon.
The former is simpler but lacks synchronization. No synchronization requires the launcher to poll icons for changes or schedule status bar updates.
The latter is more complex but is synchronized. Synchronization will allow the launcher to update the icon on notification.
I also need icons for active and inactive states for the pairing mode. The icons should be installed to /etc/launcher/icons.
I also need an xml config for the app that is installed to /etc/launcher/.statusbar.
Updated by Hammel 25 days ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
I think it would be simpler to just create a shared memory segment. That way I can open the reader in imrest and watch for updates and the app would just be imrest with a special command line option that messages the server version of imrest and updates the icon in the launcher.
videoe has inotify setup and a thread for notification that is must about the same thing - it doesn't care about what the notification is.
Updated by Hammel 24 days ago
- % Done changed from 10 to 50
I opted for a UNIX_DOMAIN socket. It's now implemented in imrest and I've made imrest act as an launcher status bar app when run as imrest-app. This compiles cleanly but needs testing on hardware.
It also still needs a launcher app.xml added to the packaging.
Updated by Hammel 22 days ago
Touches are not always working in the status bar. Also, when the touch does work and imrest-app is called, nothing happens.
iconTouchGTK[launcher.c:202] INFO Processing touch request.
iconTouchGTK[launcher.c:215] INFO Status Bar Index: 1
touchProcessor[touchProcessor.c:380] INFO TSLIB: sample 1745374360.777265: 749 4 255
touchProcessor[touchProcessor.c:382] INFO TSLIB: last 1745374360.537276: 750 4 255
touchProcessor[touchProcessor.c:394] INFO 1. diff.sec: 0 -- diff.usec: 239989
touchProcessor[touchProcessor.c:397] INFO --- Skipping fast repeat
touchProcessor[touchProcessor.c:376] INFO TSLIB: not pressed.
notify[launcher.c:871] INFO Command to run: /usr/bin/imrest-app
$ tail -f /tmp/imrest.log
initSetup[init.c:56] INFO init.setup has been called.
initSetup[init.c:75] INFO Webroot directory : /home/httpd/imrest
initSetup[init.c:76] INFO Ironman directory : /home/httpd/imrest/ironman
initSetup[init.c:77] INFO Monitor directory : /home/httpd/imrest/monitor
initSetup[init.c:78] INFO Stamp directory : /home/httpd/imrest/ironman/jarvis/
initSetup[init.c:79] INFO IoT directory : /home/httpd/imrest/ironman/iot/
initSetup[init.c:80] INFO Descriptor file : /home/httpd/imrest/monitor/descriptor
initSetup[init.c:82] INFO Monitor UUID : 827dce7d-d536-4599-a26e-6989c7a8fbe0
main[imrest.c:348] INFO Running from /home/httpd/imrest.
startWatcherProcessor[watcher.c:224] INFO imrest: Started watcher thread.
It looks like when
/usr/bin/imrest-app
is called the app doesn't realize it's being called AS the app and tries to run the full imrest server again. I probably need to use basename() on arg0 to fix that.
Updated by Hammel 22 days ago
- % Done changed from 70 to 90
Looks like it's working now.
$ /usr/bin/imrest-app Config file tag: verbose Config file tag: debugfile Verbosity level: 3 $ cat /tmp/imrest.log main[imrest.c:314] INFO Log file: /tmp/imrest.log main[imrest.c:326] INFO Running as the app. pairApp[pair-app.c:75] INFO Current icon: /etc/launcher/icons/imrest-off.png pairApp[pair-app.c:80] INFO Current basename: imrest-off.png pairApp[pair-app.c:81] INFO IMREST_PAIR_ON: imrest-on.png pairApp[pair-app.c:82] INFO IMREST_PAIR_OFF: imrest-off.png pairApp[pair-app.c:93] INFO Setting pairing to ON. pairApp[pair-app.c:106] INFO symlink /etc/launcher/icons/imrest-on.png /etc/launcher/icons/imrest.png pairApp[pair-app.c:142] INFO Pairapp is exiting.
The only thing left is to check the touch presses from launcher and the icon updates.
Updated by Hammel 20 days ago
Reset function implemented. Just needs to be tested on hardware. Currently running lockup test, however, which needs to run for a day or so.
Updated package is installed on hardware - just need to enable pairing and then reboot to make sure it comes back in non-pair mode.
Updated by Hammel about 18 hours ago
- reboot -f: doesn't clean up so on restart it's got the wrong icon and doesn't work to start/stop pairing.
- imrest: goes 25% cpu load when pairing enabled. Without pairing it is at 0% cpu load.
- icon off: imrest does not reset from 25% cpu load
If "reboot" alone is used, then the icons are okay because init script shutdown cleans up.
Probably need to have init script always reset on start. Maybe by using imrest-app to simply clean up, ie. via command line argument.