Commit Graph
29 Commits
Author SHA1 Message Date
Antoine Prieels 79ad17a7ff [FIX] hw_drivers: No connected display
In the latest version of Raspbian, when no display is connected to the
HDMI port, "tvservice -n" finds a display named "Unk-Composite dis".
Therefore, the `distant_display` was not created.
2019-09-13 09:00:50 +00:00
Antoine Prieels f03026a3d7 [REF] hw_{drivers,screen}: Convert hw_screen into an IoT Driver
Move all the logic that was inside hw_screen into an IoT Driver
in order to have consistency between devices.

TaskID: 1933834
2019-09-04 13:08:10 +00:00
Antoine Prieels 16c32f0c25 [FIX] hw_drivers: Kill MPD server on start
The MPD server was not correctly killed when the IoTBox started without
six payment terminal configured. A warning was displayed.

closes odoo/odoo#36415

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-09-04 11:58:48 +00:00
Antoine Prieels 2a7454ea6c [IMP] hw_{drivers, posbox_homepage}: Automatic load of drivers
Automatically load the IoT Drivers when Odoo starts on the IoT Box or
when the connection to the Odoo instance is done.

Allow to deactivate the automatic load to avoid overriding
modifications made on the Box.

TaskID: 2009683
2019-09-03 13:53:19 +00:00
Antoine Prieels 8449a7c607 [FIX] hw_drivers: Kill eftdvs w/o Six terminal
If no Six Payment terminal is configured, kill eftdvs if it is running.

When removing the configuration for a Six payment terminal, we just
removed the file with the configuration but we didn't stop eftdvs. The
terminal the nstayed connected to this Box even after removing the
configuration, blocking the connection to another terminal.
2019-08-29 14:09:24 +00:00
lejeune quentin 8373168bc5 [FIX] hw_drivers: Fix IoT Socket Manager
With this commit we catch OS Error when want use a new socket

closes odoo/odoo#36019

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-08-23 11:42:00 +00:00
lejeune quentin 2af13429cf [ADD] iot: Load a true certificate on IoT Box
With this commit we add the possibility to save the db_uuid and enterprise_code on the IoT Box.
We check the current SSL certificate and if it is not authenticated or not up to date
we send a request to 'https://www.odoo.com/odoo-enterprise/iot/x509'
with the db_uuid and enterprise_code to get the certificate, key, and domain associated with the client.
The IoT Box will be accessible in HTTPS according to the following domain:

https://<ip-with-dashes>.<sub-hash>.odoo-iot.com

<ip-with-dashes> being the ip address with dashes
<sub-hash> being a subdomain assigned by Odoo to a customer

Task: 1931770
2019-08-23 12:21:03 +02:00
lejeune quentin 84de7cbcb6 [ADD] iot: Improve usage of helpers in IoT Box
With this commit we move the helpers to a separate file for
easier access from the IoT Box
2019-08-23 12:21:02 +02:00
Robot Odoo e9dbf45b3b [IMP] pos, hw_drivers, hw_posbox_homepage: Six terminals
Add support for Six payment terminals.

TaskId: 1932416

Linked to odoo/enterprise#4435

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#33673

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-08-14 11:27:10 +02:00
Antoine Prieels 4e649a8ca9 [REF] hw_{driver, scanner}: Barcode scanners as IoT Devices
Barcode scanners are now part of KeyboardUSBDriver. We also add
the possibility to change the keyboard/scanner layout from an
action. The list of available layout can be retrieved with a new
route.

`hw_scanner` has been removed. Backward compatibility is ensured
because the name of the route that is now used in community is the
same that was used previously.

TaskID: 1939455
2019-08-13 15:35:38 +02:00
Antoine Prieels b62d98e9a8 [IMP] hw_drivers: Config file for eftdvs
Add a config file for eftdvs. This was requested during the
certification to allow user to change the config of the
terminal.

TaskID: 1932416
2019-08-12 08:16:04 +02:00
Antoine Prieels dc449a4ae5 [IMP] hw_drivers: support Six payment terminals
Add MPDManager to driver.py to keep a list of connected terminals
up to date.

Add the files needed to communicate with the payment terminals:
eftdvs --> MPD server that needs to run on the IoTBox
eftapi.so --> Library to connect Odoo to the MPD server

TaskId: 1932416
2019-08-12 08:16:04 +02:00
Antoine Prieels 03b2f7b77d [REF] pos: Replace hw_escpos by PrinterDriver
ESCPOS printers are now supported as IoT Devices, just like any other
printer. We now transform the receipts to JPGs, transform these JPGs
into ESCPOS commands and send them via Cups, adding support for network
printers. Since we now print images, we can now print special
characters and therefore add support for other languages such as
Arabic.

The JPG is generated in the browser, with the help of html2canvas.

`hw_escpos` is left untouched to allow backward compatibility and
should be removed when v12 is no longer supported.

In the PoS, all the code for printing has been moved from ProxyDevice
to a separated JS file.

TaskID: 1939455
2019-08-08 11:53:37 +00:00
pha-odoo 28c2e642cb [FIX] iot: bluetooth work with serial
Using path such as '/dev/ttyUSB0' to connect to a serial port
makes it impossible to use the bluetooth.

We now use the locations in '/dev/serial/by-path' to connect to serial port,
which does not affect bluetooth connections

closes odoo/odoo#35302

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-31 10:54:46 +00:00
pha-odoo 120f890ecf [FIX] iot: remove check for abstract classes
The check for abstract driver classes results in some errors being logged on the iot box.
Since this check is not essential at this point, it was removed and will be reintroduced later
if needed.

closes odoo/odoo#35014

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-19 11:55:01 +00:00
pha-odoo c4aade63fd [IMP] iot: add iot serial drivers
This commit adds a base serial and a base serial scale iot drivers,
as well as drivers extending them for the two previously supported scales
(ADAM EQUIPMENT AZEXTRA and TOLEDO 8217).

Since just adding the new drivers creates a race condition
between the old drivers and the new, the old drivers need to be removed.

The IoT scale drivers need to be backward compatible and compatible with the community version,
so client using an IoT box with those versions can still connect a scale to the PoS.

Task: 1892412
2019-07-17 08:02:13 +02:00
Martin Trigaux 5d57e1862f [MERGE] Forward port of saas-12.4 to master up to beba36416f
closes odoo/odoo#34924

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 15:45:24 +00:00
Martin Trigaux beba36416f [MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c 2019-07-16 16:36:40 +02:00
lejeune quentin a8004118b2 [IMP] point_of_sale: Updating the date of the IoT Box
before this commit the date of the IoT Box did not update.
With this commit we restart the service timesyncd on the IoT box

Task: 2034930

closes odoo/odoo#34789

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-11 13:54:53 +00:00
lejeune quentin 3c66ed1405 [FIX] hw_drivers: Avoid duplicates identifiers in devices
Before this commit the identifier integrate the BUS and port to identifiate USB devices
Now we check if there are duplicates devices before increment the identifier

For other loop we add identifier in the iot_device object

task: 1963500

closes odoo/odoo#32737

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-09 08:08:16 +00:00
lejeune quentin f5676fabea [IMP] hw_driver: inform the odoo instance of connected and disconnected devices
Before this commit, we only sent the list of connected devices to
the odoo instance (thanks to `self.send_alldevices`) when a device
is newly connected. Now, we also send this list when a device is
disconnected. We also try to call this method once if multiple devices
are connected/disconnected during an iteration.

task-id 1939338

closes odoo/odoo#32678

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-03 08:14:28 +00:00
lejeune quentin ccb2835ccc [IMP] hw_drivers: Adds the ability to listen to a port
With this commit it is now possible for the IoT Box
to listen on a specific port of the box to interact
with a device via TCP / IP.

We use the library 'socket' to listen on port 9000
and if a request comes on this port we create an IoT Device
2019-05-29 15:49:03 +02:00
lejeune quentin ae35e16093 [IMP] IoT : Automatic registration of the IoT Box in HTTPS without certificate
When we are on HTTPS and we want to connect a box with the scan
we need to accept manually the certificate of the box.
With this commit we don't need to accept manually the certificate.
We don't have problem of mixed content if we use the onload method of Image object
So we load a image and put on parameter the token of the odoo DB to make a connection.
2019-04-02 15:53:02 +02:00
lejeune quentin 61c824764c [FIX] IoT : Variable name correction
This commit replace "data" by "iot_box" which is more representative
of the values it contains
2019-04-02 15:53:02 +02:00
lejeune quentin 1f845e9110 [IMP] IoT : IoT refactoring - With longpolling
Improve the implementation of IoT.
Allow both-direction communication between iot box and devices.

Now a device can send its value / status as soon as it changes. Not only when he receives a request.

Now the box have only 3 routes:

/hw_drivers/action
parameter: session_id, device_id, data
used to ask at a device to make a action (take picture, make print, ect...)

/hw_drivers/event
parameter: listener
listener is a dict where you have the session_id and a list of device_id to listen
this route wait to answer that we call device_changed for a device_id with data or value

/hw_drivers/box/connect
parameter: token
used to register the box to a Odoo database
token contain the url of Odoo database and a unique number that allow the IoT Box
to connect box in the hour

task : 1906910
2019-04-02 15:53:01 +02:00
lejeune quentin c516cb90af [ADD] IoT : Add printer compatibility with the LPD protocol
closes odoo/odoo#29875
2019-01-15 15:23:24 +00:00
lejeune quentin e5c62987b4 [FIX] IoT : HTTPS disable certificate verification by URLLIB3 2019-01-15 15:23:24 +00:00
lejeune quentin e7993f2faa [IMP] IoT : Allow to configure CUPS server
We can modify printers or CUPS configuration
These modifications will be save on IoT Box
2019-01-15 15:23:24 +00:00
Josse Colpaert 3d9ebb11b6 [ADD] hw_drivers: drivers management module for the IoT Box
- Routes to get device/driver statuses from the browser
- Framework for managing and downloading drivers for devices
connected to the IoT Box
- Automatic detection of printers and cameras in the network
- Built-in detection for USB and Bluetooth LE devices and checking
if a driver matches the device
- Authentication of the box into Odoo
- Inform Odoo of the connected devices and giving them a unique
identifier so they can be called from the browser

Thanks to qle, specially for fswebcam and cups
2018-09-25 23:01:40 +02:00