Bus info screen

Hi All,

I would like to create an information screen for my son’s primary school. There are two small bus stops, and the buses are regularly delayed, sometimes by several tens of minutes. I would like to put the screen in the school lobby so the kids can see it and decide to wait inside instead of stepping outside and hoping for the bus.

I have created a simple Python script that grabs bus data from a local bus carrier, but I am having trouble updating the values on screen. I would like to run this grabing script in my household and send only neccessary value updates over api, because I don’t have good access to the school’s network. It should be as simple as possible on the school’s end.

I forked the package-screen-info repository and tried adding a line with a variable that I can modify.
Repo: GitHub - Vitaris/package-screen-info

I modified the util.DataMapper, which was used in the example:
node.lua

I tried modifying the variable with this command:
curl.exe -u ":$env:IB_KEY" -d "data=value 123" https://info-beamer.com/api/v1/device/$DEVICE/node/root

I’m getting an OK response from the curl command, but nothing is happening on the screen.

I believe this is an easy thing to do, and I would be grateful for any assistance.
Thanks, Viktor

Two issues:

  • In your Python code you use api.value which doesn’t exists and prevents the service from starting. Remove line 26 and 28 from here.
  • Your API call is incorrect. Use:
    curl -u:${API_KEY} \
      https://info-beamer.com/api/v1/device/${DEVICE_ID}/node/root/value  \
      -d 'data=this is a test'
    
    root within the path addresses the top-level node.lua code, while the appended value is then dispatched into data_mapper.

This successfully changes the Value: row in on screen. Hope that helps.

Great! It works now. Thank you!

Best regards,
Viktor