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.
We search for USB devices that identify as a printer through their
DeviceClass or one of their InterfaceClasses. The issue is a lot of
printers use vendor-specific Device/InterfaceClasses.
Apparently the Epson TM-T88IV is one of those devices. So in order to
work around this, we now first look for a USB device that identifies as
a printer. If those do not exist, we pick the first Epson device, if
those do not exist we pick the first Star device.
Perhaps we should instead start using some kind of probe-based approach
to identify ESC/POS compatible devices.
In order for the printer to work we need to configure it in USB vendor
mode. This means it will not have a USB interfaceClass of 7. So when
we don't find any USB device that identifies as a printer, we search
for Star devices and use the first one of those we find.
This should be reasonably safe because Star does not manufacture other
devices apart from printers that one would attach to the posbox.
Although it might be a good idea to make sure a printer device is
properly closed, trying for >1 min to do so is too much. It can cause a
>1 min delay between receiving a receipt and actually printing. Also,
just because the device is not cleanly closed does not mean that it will
not work when we open it again.
It makes more sense to just look for usb devices that identify as a
printer and use whatever we get. This saves us time having to explain to
users how to add their particular printer to the whitelist to test.
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.
This commit contains the patches from the now obsolete 'posbox'
branch. These patches were written by Martin Donies (@mdo-odoo) and
Frédéric Van der Essen (@fvdsn).