Fully kiosk on Chromebox - MQTT/Switch

Hello there

Please allow me to explain the surroundings, before I explain the main problem…

I recently switched my wallmounted tablet to a Chromebox and an attached Zenscreen touch. On the tablet I used to wake it up by using the camera motion feature within Fully Kiosk, whenever I entered the room.
Now the Zenscreen doesnt have a camera, so I had to come up with another solution. Also it seems that Fully kiosk can send but not receive MQTT commands, like the “wallpanel” app, I have on the tablet in my bathroom.

I’d like to credit the author in respect for the below code, but I cannot find the original post in here which explained to send curl json commands to Fully kiosk (I believe it was @ReneTode though) - so credits hereby given !

I have in my configuration.yaml a switch stating :

  - platform: command_line
    switches:
      chromebox_screen:
        command_on:"/usr/bin/curl -X POST 'http://192.168.0.35:2323/?cmd=screenOn&type=json&password=somepassword'"
        command_off: "/usr/bin/curl -X POST 'http://192.168.0.35:2323/?cmd=screenOff&type=json&password=somepassword'"
        command_state:'/usr/bin/curl --silent -X GET "http://192.168.0.35:2323/?password=somepassword" |grep "Screen status" |grep "on\|off" |sed "s/<[^>]*>//g" |sed "s/Screen status//g" |sed "s/Turn on//g" |sed "s/Turn off//g"'
        value_template: '{{ value == "on" }}'
        friendly_name: chromebox Screen

and in my automation :

- alias: Chromebox Screen On
  trigger:
    platform: state
    entity_id: binary_sensor.kokken_sensor_motion
    to: 'on'
  condition:
  - condition: time
    after: 06:00:00
    before: '23:59:00'
  action:
  - service: switch.turn_on
    device_id: chromebox_screen

All good and logic, but here comes the problem.

It turns out that Android apps (on Chromebox/Chromebook) have a different IP address than the Chromebook / Chromebox itself. That is because of the way ChromeOS runs Android apps in an isolated container.

So, my Chromebox has an IP address of : 192.168.0.35, but the container Fully-Kiosk runs in, has an IP address of 100.115.92.22.

I simply cannot find a way to "NAT Forward the 2323 port between those two, hence the automation seems to send the command correct, and with some port sniffing on the Chromebox I can see that it arrives OK on 192.168.0.35, but it never forwards it to the container address 100.115.92.22.

I have written 3 emails to fully kiosk support for help as I have paid for 4 licenses, but unfortunately it doesn’t seem they read their inbox…:wink:

I hope someone has faced and solved this problem, or has suggestions on how to wake up Fully Kiosk in another way when detection motion on an external motion detector (in this case Philips HUE).

Thankful for answers, Michael

thx for the credit, but it wasnt me :wink:
your problem is not related to fully kiosk, so thats probably why they dont respond. (they got enough to do with related questions)
its a chromebook and container problem (like with docker) so i would search for support there.

if there is no cam, there is no motion detection with fully, so an external motion detector seems like the only solution.

Hello ReneTode

Thank you for the fast response. The re is no Cam or motion detection, as I have hooked it up with a Zenscreen Touch, so I’ll have to dig further into, how I can get the curl command “NAT’ted” through to the Chrome container.

Thanks again.
Michael

This might be worth taking a look at - Port forwarding | ChromeOS for developers

or this - https://chrome.google.com/webstore/detail/connection-forwarder/ahaijnonphgkgnkbklchdhclailflinn

According to Github:

Background info: android runs on a chromebook on a NAT interface that is not exposed directly on the LAN. Certain services are forwarded (such as mDNS). Everything else, not. This app lets you setup simple forwarding rules to have certain ports get forwarded to the internal android interface.

So the Connection forwarder from the web store looks like it will be your best bet.

@MichaelJ2600
Hello, did you get the port forwarding thing working or what is your solution now?
I’m looking to buy a Chromebox 3 as nothing I’ve been able to get my hands on has been stable. It’s just hard to find an Android device that you can connect an external touchscreen to that is really stable. It’s either poorly customized Android or something else.

Hello Brot123

For some reason it solved itself. I had no need for adding Linux developermode or anything else.

What you’re not looking for is, - I didn’t do anything, it solved itself. Sorry for an answer, you really can’t use for anything !

Having said that, my Chromebox is super-stable. Noting that nothing else than Home Assistant is installed/running on it (Chrome browser), I believe the uptime has only been influenced by my manual HA restarts…

As I mention above, I have it connected to a ASUS Zenscreen Touch 15". It took me a while to figure out how to set the screen up to not “charge” - and even worse - discharge, as the screen can run on battery, but now it works all fine.

Final thought : I still do not think it’s possible to NAT anything on the Chromebox,