Commit Graph

25 Commits

Author SHA1 Message Date
Lucas Perais (lpe) 837bd78672 [FIX] point_of_sale: fix perms in posbox script
Before this commit, the posbox was built and in the process the permissions of the repo were whanged
As a result, there was a diff in the repo, making it un-upgradable

After this commit, the permissions on the posbox' Odoo repository are unchanged, and no diff is to be seen
2017-11-16 13:14:00 +01:00
Lucas Perais (lpe) f5004154a2 [FIX ]point_of_sale: hardcode jessie in posbox scripts
Before this commit, the latest version of Raspbian was chosen.
It is not very helpful though as if something goes wrong, we don't on which part it is.

Also, fix python dependencies for the image
2017-11-15 14:42:16 +01:00
Joren Van Onder 9f31e50ee9
[FIX] point_of_sale: don't launch Firefox before Odoo has started
When using Wi-Fi the Odoo instance on the POSBox will start after a
Wi-Fi connection is established. This takes a bit longer than when
you're using a wired connection. If Firefox gets started before you
end up with a 'Could not connect to localhost:8069' error.
2017-06-14 14:02:00 -07:00
Lucas Perais 1600216c1d [ADD] hw_screen: implement support for customer facing displays (#15303)
This adds the hw_screen module which is responsible for receiving
rendered HTML from a POS client and sending it to a running Chromium
browser. This is done by sending Remote Debugging Protocol messages over
a WebSocket provided by Chromium. This allows hw_screen to evaluate
arbitrary JS. This is used to seamlessly (without flickering) update the
browser.

This also includes changes to the POSBox. X, Chromium and some
miscellaneous other programs were added. Functionality was added that
automatically displays a fullscreen, UI-less Chromium browser when the
POSBox starts up. This is accomplished through x_application.sh, which
gets executed only when a display is detected. After the browser starts,
it will display a specific screen until it receives the first order update
from a POS client.
Creates a public controller to be able to display the interface on an external
device not connected to the posbox (e.g. tablet)

Courtesy of JOV, LPE, ODO and MAT
2017-03-21 11:50:12 +01:00
Olivier Dony d1b0b9e656
[FIX] point_of_sale: check required commands before building POSBox image 2016-11-14 17:11:57 +01:00
Olivier Dony 2fd4dfca7f
[FIX] point_of_sale: update POSBox image creation script
- ngrok download URL has changed
- default kernel for raspbian image has changed and needs to match
- remove pre-existing git checkout to avoid conflicting
- wait a few seconds after setting up loop dev with kpartx to access image
  contents - sometimes required to let the device appear in /dev
2016-11-14 17:11:57 +01:00
Joren Van Onder 75dbd545c8 [FIX] point_of_sale: mount /boot when building the POSBox image
We don't mount /boot in fstab to prevent systemd-udev looking for
corresponding kernel modules in /lib/modules. We need to do this
because the modified kernel-qemu image we use for emulation is usually
not 100% the same version as in the Raspbian image. Therefore
systemd-udev won't be able to find the 'correct' kernel modules in
/lib/modules.

This causes issues when the raspberrypi-kernel package is updated
however. apt will update /lib/modules and will write the new
kernel{7,}.img files to /boot. Before this patch /boot was just a
directory on /dev/sda2, not the 'real' /boot which is on /dev/sda1. So
you'd end up with old, not updated kernel images but new, updated
kernel modules in /lib/modules.

This mounts /boot after the system booted. /boot gets mapped to
/dev/sda1 by /etc/udev/rules.d/90-qemu.rules.

Fixes #12650
opw-682320
2016-07-05 16:18:25 +02:00
Joren Van Onder f5a527fb0a [IMP] point_of_sale: move POSBox AP to a less used subnet
When the POSBox boots without a network cable attached it will
automatically launch a wireless AP that people can connect to. This
allows them to configure what wireless network the POSBox should connect
to.

This wireless AP was configured to use the 10.10.0.0/24 subnet. The AP
itself was on 10.10.0.1. Although this is fine if used as intended it is
a quick way to take down an existing network if you where to plug in an
ethernet cable after the wireless AP has started. 10.10.0.1 is commonly
used by routers all over the world and plugging in a booted POSBox into
their networks will cause serious issues because the POSBox will share
the same IP as the router.

This moves the POSBox AP to the 10.11.12.0/24 subnet, with the AP on
10.11.12.1.

This also makes the DHCP server listen only on wlan0 because otherwise
you can end up with two DHCP servers on the same network which would
still break stuff.
2016-04-14 11:24:48 +02:00
Joren Van Onder fd43faac16 [IMP] point_of_sale: redirect POSBox image init script output to file
Useful when updates to the initialization scripts don't go as
planned. This leaves something to inspect.

The initialization script already automatically stops (because of 'set
-o errexit') but it was a bit tricky to actually see what went wrong
because scrollback in QEMU isn't great.
2016-04-14 11:24:48 +02:00
Joren Van Onder 5af1c085bf [IMP] point_of_sale: migrate POSBox to Raspbian Jessie
The main reason for doing this is supporting the new Raspberry Pi 3. No
functional changes where made.

For Raspbian Wheezy we used to download the full image and strip it as
best we could to obtain a reasonable image size for people to
download. Since Raspbian Jessie the Raspberry Pi Foundation has started
releasing an official minimal image (Raspbian Jessie Lite) which we will
use from now on to build our image. One downside of this is that the
minimal image is a 1.3 GiB image which is too small for our
purposes so it has to be resized.

Because Raspbian Jessie migrated to systemd we cannot rely on
/etc/init.d/rcS to set up the ramdisks anymore. Jessie provides a
compatibility layer so old SysVinit scripts still work but rcS does not
block like it does in a SysVinit system, it is run in parallel with
other startup services. In our case this is a bad thing as setting up
the ramdisks has to be done before any other services are started. To
accomplish this the rcS hack has been migrated to a systemd service
running before basic.target and with DefaultDependencies=no. This has a
similar effect as the rcS hack because normal systemd services (with
DefaultDependencies=yes) all require basic.target by default.
2016-04-14 11:24:48 +02:00
Joren Van Onder cdf21ebe4a [FIX] point_of_sale: make POSBox print only one ticket when losing wifi
The POSBox attempts to maintain whatever Wi-Fi connection it has as best
it can. When it loses it's current Wi-Fi connection it will attempt
to recreate it every 30 seconds. This works well, but a side-effect of
this is that it'll also print a 'Could not connect to LAN' ticket every
time it fails. If you where to leave the POSBox with Wi-Fi on for an
extended period of time you could return to a lot of 'Could not connect
to LAN' tickets.

This makes it so that the 'Could not connect to LAN' ticket only gets
printed once upon connection loss. Although it would be simpler to just
not print this ticket at all when losing connection, it is very useful
to know when the POSBox has lost connection. Otherwise when it loses
connection it would stop working and noone would know why.
2016-02-09 16:30:01 +01:00
Joren Van Onder 184471dbf1 [IMP] point_of_sale: add hw_blackbox_be to posbox image
This removes server_wide_modules from odoo.conf entirely because it
wasn't actually used.
2015-12-09 14:52:10 +01:00
Joren Van Onder 617ba72a9d [IMP] point_of_sale: add remote debugging capabilities to the posbox
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.
2015-10-09 09:38:09 +02:00
Joren Van Onder 3726612735 [FIX] point_of_sale: rm with -f does not return non-zero 2015-10-09 09:38:09 +02:00
Joren Van Onder b25af944a1 [FIX] point_of_sale: remove raspi-config message on posbox
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.
2015-10-09 09:38:09 +02:00
Joren Van Onder 546a1d4a32 [IMP] point_of_sale: support Wi-Fi on the posbox
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.
2015-10-09 09:38:09 +02:00
Joren Van Onder 1db1027cd5 [IMP] point_of_sale: do more aggresive logrotate on rsyslog logs
/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/*)
2015-08-26 15:12:40 +02:00
Joren Van Onder 02f0cbe353 [IMP] point_of_sale: keep as many scripts as possible in the odoo repo
This way we don't require a new image when we want to change eg. the
odoo configuration file.
2015-08-26 15:12:40 +02:00
Joren Van Onder f0551d2d8d [IMP] point_of_sale: get rid of avahi-daemon on posbox 2015-08-26 15:12:40 +02:00
Joren Van Onder 41929bd997 [IMP] point_of_sale: posbox_create_image fixes
- 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
2015-08-17 21:26:53 +02:00
Joren Van Onder d8c5299dc0 [FIX] point_of_sale: posbox_create_image fixes
- 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.
2015-08-14 11:08:51 +02:00
Joren Van Onder fa279c3206 [IMP] hw_posbox_upgrade: new upgrading process for v13 posbox
This calls ~/posbox_update.sh, which will simple do a git pull followed
by a reboot.
2015-08-11 15:20:56 +02:00
Joren Van Onder 54697a551c [IMP] point_of_sale: migrate the script that sets the rpi leds
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).
2015-08-11 15:19:57 +02:00
Joren Van Onder 86762ef30f [IMP] point_of_sale: add scripts to generate posbox images
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.
2015-08-11 15:19:57 +02:00
Frédéric van der Essen 68c2802fd9 [WIP] point_of_sale: adding untracked files before bisect galore
bzr revid: fva@openerp.com-20120727140552-a5b1j344aa60cemp
2012-07-27 16:05:52 +02:00