Skip to content

Latest commit

 

History

History
 
 

dev-mode

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

A rapid package development tool for info-beamer hosted

Learn more about this feature on https://info-beamer.com/lnk/dev-mode.

The dev-mode tool allows you to rapidly develop new packages. It works by syncing local changes directly to an info-beamer hosted device of your choice. That way you avoid the slower git pull approach and instantly see the effect of changes you make.

You can rapidly build new packages or tweak existing packages that way: Just edit their node.lua file or image and they get instantly synced to the device.

As you can't use the info-beamer dashboard to configure your package you'll have to provide your own config.json file while developing. This might be a bit tricky to get used to as usually info-beamer hosted generates those files for you.

Preparing your info-beamer device

The first thing you'll have to do is enable the rapid development mode on your info-beamer device. For that, place an empty file /config/dev-mode on the SD card of your device and restart it. The device is now ready.

WARNING: Never enable developer mode in an untrusted network or for production devices: developer mode allows unauthenticated access to your device and anyone with network access to the device can upload any content to it. This might result in a complete device takeover.

Preparing your development machine

Fetch the dev-mode Python tool from this repository. It should work with python2 or python3 out of the box. You'll have to install the python-pyinotify and python3-pathspec packages.

If you have any kind of firewall active you must allow incoming connections to TCP port 3333 to your development box.

Syncing your first package

If you're working on an info-beamer package you should have all files for that package in or below a single directory. Run your dev-mode tool like this:

$ dev-mode 192.168.1.101 /path/to/package

where 192.168.1.101 must be replace by the IP of the device you prepared in the above step. dev-mode will contact your info-beamer device and instruct it to fetch the package files from your dev machine, just like it usually fetches them from the info-beamer hosted file storage system.

If you don't have a package ready, you can use the included minimal example in example/. Start dev-mode like this:

$ dev-mode <device-ip> example/

Then open the node.lua file in another terminal, edit the gl.clear values and save the file. Your changes should be visible immediately on the device.

The syncing process on the device directly fetches the files and doesn't do any of the syntax or semantic checks that info-beamer hosted usually enforces when importing or updating packages on info-beamer.com. So the development is less strict and it makes sense to push your code to info-beamer.com once you've completed a task using the rapid development mode.

Usually packages you develop don't include a config.json file. When using the dev-mode tool, you'll have to write your own file. You might even include it in the package source code itself (unless it contains any secrets of course), as config.json files are ignored by the info-beamer.com import process.

It is always recommended to ssh into your device to read the info-beamer log output. Have a look at the documentation to learn how to do that.

FAQ

Why is "dev-mode" blinking on my device?

This is there to remind you that your device is configured for developer mode and to prevent the device from accidentally used in production.

How can I create a config.json similar to the real one generated by info-beamer?

Have a look at the package reference. All option types and their expected config.json output are documented. If you don't want to generate a config.json from scratch, the easiest way to get one is to push your package to info-beamer.com, install it on your device and then take a look at the generated config.json file.