Sometimes it's useful to ssh into a posbox to quickly troubleshoot an
issue. Talking customers through port forwarding is very difficult
however. We use ngrok to solve this issue.
This implements an interface that allows a user to enter an ngrok
authentication token. After this, ngrok can be started and we should be
able to remotely connect.
Note that ngrok does NOT run by default on the posbox. It can only be
started manually by the user.
Every time the posbox boots it would say something like:
This raspberry pi is not configured, please run raspi-config
Which is a leftover from the original raspbian image. Raspi-config is
removed on the posbox because we don't need it.
This allows people to connect the posbox to networks using a wireless
network adapter.
When plugging in a USB Wi-Fi adapter and no network cable, the posbox
will boot and host its own Access Point called "Posbox". Users can
connect their device to this network and can then connect to the posbox
the usual way.
An interface for has been provided that also allows users to instruct
the posbox to connect to a different Wi-Fi network. This is useful when
the client is not running Odoo locally.
It is also possible to make this configuration persistent. With a
persistent Wi-Fi network configuration, the posbox will always try to
connect to the specified network after a reboot.
Attempts have been made to make the Wi-Fi connection as robust as
possible. Upon connection loss, the posbox will automatically attempt to
reconnect.
/var/log/syslog gets filled up quicker than usual because of all the
crontab logs:
Aug 26 09:29:01 raspberrypi /USR/SBIN/CRON[21223]: (root) CMD (rm /var/run/odoo/sessions/*)
- set keyboard layout to us
- install GNU screen
- add udev rules to make USB devices accessible to the usbusers group
- setup crontab to delete odoo sessions/*
- define inputrc and vimrc
- don't add comments in posbox ld.so.preload, it causes the second line to be
interpreted as a library.
- allow image creation in headless environment. This checks whether or not X is
running and runs qemu-system-arm with or without graphics.
When the server is answering HTTP requests, the status led (green one)
of the Raspberry Pi will turn on. Contrary to the previous script this
will not exit and keep running every 5 seconds. This way we can easily
troubleshoot connection issues (if led is on and we can't connect it's a
network issue, otherwise it's an issue with Odoo).
Instead of continuing to build upon the old images, these scripts
implement a reproducable way to generate new posbox images. The
generated images will be based on the latest stable Raspbian
release. The image will be created with the help of qemu-system-arm,
which will boot up the image and execute a script that will set up the
posbox image.
This way everything necessary to set up a posbox is readable in the
scripts and accompanying files, instead of being hidden in an image.