Commit Graph
77 Commits
Author SHA1 Message Date
lejeune quentin ee519c222f [REF] hw_posbox_homepage: Use helpers to get mac address in homepage
We use a library to get mac address of IoT in homepage.

however we already have a function that does this in the helper in hw_drivers

closes odoo/odoo#46631

X-original-commit: ae78e9cdde777ffac6f08a35dd00a540c92130bb
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-03-02 09:01:11 +00:00
Antoine Prieels cad11eed98 [FIX] hw_drivers: Read weight from IoT Scale
We had two issues when reading the weight from a scale connected to
the IoT Box :

When using the '/hw_proxy/scale_read' route, if the same weight was
read twice, the value in PoS was reset to 0.
If the product was placed on the scale before opening the weight
screen, the weight was never read.

closes odoo/odoo#46432

X-original-commit: a08c5157f0b042e2ee250fc7b431b90451c7781a
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-02-27 12:36:27 +00:00
Antoine Prieels a200c6ddf8 [REM] hw_drivers, hw_posbox_homepage, pos: Remove MPD
Remove the MPD server and Six configuration from the IoT Box.
MPD will be replaced by TIM, which doesn't require the IoT Box.

closes odoo/odoo#46424

Taskid: 2188566
X-original-commit: 9d43308a8f6b521d3d18f7fc472303f58f56a0c3
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-02-27 11:17:15 +00:00
lejeune quentin 314410458b [FIX] hw_drivers: In IoT update route list after loading driver
For update correctly the route list of IoT after loading driver
we need set 'http.addons_manifest' to a empty json

Linked to 97c09e1c77284836c7c46b4e70d4f12eb48ce91b

Reboot not needed after a update

Linked to b77486753b7ae220a531ee09c529fb5eb944b0e2
Linked to 181a62cb57e143611ca1fbf0779cfd041d2a3cf8

closes odoo/odoo#46386

X-original-commit: 87b127efed97c1f6fad18d6ee6b5924a9b2c70f2
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-02-26 17:32:05 +00:00
lejeune quentin 17c181ac74 [FIX] hw_drievrs: Replace SSID on the first boot
We replace the SSID of the IoTBox with a unique SSID

closes odoo/odoo#46255

X-original-commit: c847c1cb149e386331ff2e5b19a58862e1b66714
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-02-25 14:08:49 +00:00
lejeune quentin fff277a4a7 [FIX] hw_drivers: Do not send request if the IoT is in access point
If IoT Box is in access point mode and a server is configured
the box try to reach the server.
But in access point mode all requests are redirected to the box

So now before return True in function 'get_odoo_server_url'
we verify if the service 'hostapd' is inactive

closes odoo/odoo#46141

X-original-commit: 365f0e384630bad16e0872d2307702fca5a4e295
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-02-24 16:03:12 +00:00
lejeune quentin e8611b363a [IMP] point_of_sale: Add the possibility to the IoT Box to perform a self-flashing
To be able to flash the partition on which the IoT Box is executed,
we must create a third partition and install an OS there to be able
to boot on it and flash the partition of the IoT Box

- Creation of the third partition
- Raspbian download and checksum verification
- Installation of Raspbian on the third partition
- Download the IoT image on the Raspbian partition and check the checksum
- Reboot on the Raspbian partition
- Installation of the IoT image on the second partition
- Reboot on the IoT partition
- Cleaning and deleting the third partition

closes odoo/odoo#44430

Task: 2161955
X-original-commit: 407d9a88a3d23ed49ed5a2c5fa4d211cec43edfd
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-01-31 18:34:02 +00:00
Pierre Masereel d66553cafd [FIX] hw_drivers: reload routes after loading drivers
closes odoo/odoo#44263

X-original-commit: 97c09e1c77284836c7c46b4e70d4f12eb48ce91b
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-01-30 10:02:25 +00:00
Antoine Prieels 3006636820 [FIX] hw_drivers: KeyboardUSBDriver: pedals not working
Pedals plugged in the IoT Box were not sending any data to the
connected Odoo DB.

The name of the device couldn't be retrieved, and the pedals were given
the default name "Unknown keyboard or scanner".

Since this default name included "scanner", the device was recognized
as a barcode scanner and no data was sent until Enter was pressed,
which never happened.

closes odoo/odoo#43914

X-original-commit: dba811f67439807a67749e6a41dbf92f4060a326
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-01-24 11:44:53 +00:00
Joren Van Onder e1a99b5027 [FIX] hw_drivers: read modifier keys in the event loop
Key input is handled in an evdev event loop. Before this commit the
state of modifier keys like shift, caps lock, ... were read when the
event was being processed. This doesn't always work because the evdev
events are processed asynchronously, i.e. when key A is being processed
in Python key B may have already been pressed.

Some devices that type fast, notably the Magtek card reader, this leads
to modifiers being applied to the wrong characters. Here's an example
before the patch:

5895000020000006^TEST/VAnTIV^251200000000000000?;4895000020000006=251200
000000000/\0600\0dD15ac71B75BA468E51F4e657529ADF6E3BDAC0A86A59B7adA12029
22F64BB55E74880A1908AD08AFC9372ADe21FD1E74D409C912C1A5|5C3D07B727DE46DaF
B6D8ED2007DB219F49FAC1311F0fa01474FC5BC621F33F915BE77D8DAF5E69A||6140300
0|076C0B3B0704CD78D7CF7Dc5B2ED3F0Ca3ad2e6c88d1F2310B7DB96973b4D556c2f9e4
016C60a7DB581990567FE5656E02C27276FA43BFE|B2ECCDE070215AA|336a4f78bb3c4C
\901209b2eCde000f3\4fC\100

This is what it looks like after the patch:

%B4895000020000006^TEST/VANTIV^251200000000000000?;4895000020000006=2512
00000000000?|0600|FE511F7BA7C38A4FA85D0135E58DDC798E557819356DADA132ECBE
D95184CCC77D7E2B1AE7E8AB076488B9757CA2A046C70590D01FA86217|5DAFE6EC44372
A3EF0358D42D08D9246DD8D2837150954B758199207697EFEB08A71B38B2E1690CE||614
03000|584CB8EBE3B17D2828C3B010DFB4E63E9F5036705CF7E547707DC75A9408E958DC
A3052B03031EA0F3B1F1163E40EF3F542B70F9FFD7912D|B2ECCDE070215AA|21352532D
D6E7334|90CDE0001FA|06A6||1000

These are some of the issues visible in the above example:
- there's a 5 instead of a % (on QWERTY SHIFT-5 is %)
- the n in VAnTIV is lowercase
- there's many /'s which should be ? (on QWERTY SHIFT-/ is ?)
- there's many \'s which should be | (once again on QWERTY SHIFT-\ is |)

To solve the issue, we read the state of the modifiers in the same event
loop.

opw-2122553

closes odoo/odoo#42767

X-original-commit: caa4c7ef6d23f695827b58e60a013a9438eb67cf
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-01-06 13:54:07 +00:00
Joren Van Onder d8b384e6cd [FIX] hw_drivers: detect Magtek card reader as a barcode reader
It behaves exactly the same as a barcode reader, and pos_mercury uses
the barcode nomenclature to make it work. For reference, the full name
is:

Mag-Tek - USB Swipe Reader

opw-2122553

X-original-commit: 635f1ea8527f4489b8c56b5d18856c7d2c60737e
2020-01-06 13:54:06 +00:00
Antoine Prieels 6e07e0b4b0 [FIX] hw_drivers: Use branch of connected DB
Preivously, the code of the IoT Box was retrieved from the branch that
was used during the build but the drivers were retrieved from the
connected Odoo DB. Both could be in different versions, which forced
used to make old drivers compatible with the new Box or new drivers
compatible with old versions of the Box.

All of this made it quite hard to modify the existing code, even for
new versions of the Box in master.

When connecting the IoT Box to an Odoo DB, we now retrieve the version
of Odoo that is used and checkout the Box to this branch. This means
that we can now modify the code of the Box in master without having to
worry about users using the latest build with older DBs.

Taskid: 2120749
X-original-commit: 6af5d669593a4f431d14fce08c6151932f97da82
2019-11-26 12:31:37 +00:00
lejeune quentin ef09a4f44e [FIX] hw_drivers: Fix printer unknow in PrinterDriver
We add a condition to add printer.
Printer, for protocol DNSSD and LPD, must have a "model"

closes odoo/odoo#41591

X-original-commit: a07f118fc7182fa96344fad4a0164ed86c446352
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-12-09 12:47:59 +00:00
lejeune quentin 4bb7fa19f1 [FIX] hw_drivers: Fix detction method for printer
Actual IoT Box not detect correctly Epson TM-T88v.
Now we can detect printer even if name is 'Unknow'

closes odoo/odoo#41563

Taskid: 2153108
X-original-commit: 4c7a1d7a9ba2ad0fbdd92b3a73b0d6294cb6e4a3
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-12-09 09:56:47 +00:00
lejeune quentin 5caa5d7d2e [IMP] hw_drivers: Change IoT Box version
Change the version of the IoT Box.
From 19_10 to 19_12

closes odoo/odoo#41109

X-original-commit: 2b8779dc657a5a2b877ad2a552dd0dfda0071357
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-29 10:23:15 +00:00
Antoine Prieels 6f645925a4 [IMP] hw_drivers: Clean MPD manager in driver.py
We clean the code for the MPDManager by removing useless lines and
simplifying the way we run the MPD server.

closes odoo/odoo#40892

Related: odoo/enterprise#6892
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-28 14:04:33 +00:00
Antoine Prieels 2e34d456e8 [FIX] hw_drivers: Redirect exceptions to log file
Exceptions were logged to stderr so we couldn't see them when Odoo was
running as a service on the IoT Box. We now redirect stderr to the logger
to see track errors in the log file too.

closes odoo/odoo#41028

Taskid: 2146835
X-original-commit: 54a1919cbc37f5832ce110605c29b222c7a5bfe9
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2019-11-28 08:32:28 +00:00
Antoine Prieels 738868a1db [IMP] hw_drivers: Dual customer display
Customer displays were all using the same URL and therefore could only
show the same products. We now use different URLs per screen.

Two screens connected to the same IoT Box can now display customer
displays from different POS.

closes odoo/odoo#41026

Taskid: 2123511
X-original-commit: 12569b0e7f7a9e447f8df908597131911c5cfef8
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2019-11-27 14:15:18 +00:00
Antoine Prieels ad846fcee5 [IMP] iot: Dual screen support for RPI4
We now support the RPI4 which has 2 micro-HDMI outputs, while the
prvious driver only supported one display. We add support for a second
display.

Taskid: 2123511
X-original-commit: 5886c3a864c990fcd7b852baafab752e7da90494
2019-11-27 14:15:18 +00:00
Antoine Prieels 53bc9dcdc6 [FIX] hw_drivers: Print status ESC/POS printers
The status ticket contains ESC/POS commands but was printed on all
printers connected in USB. Plugging a printer that doesn't support
ESC/POS resulted in undefined behaviors.

We now only print this status ticket on ESC/POS printers.

closes odoo/odoo#40972

X-original-commit: c6a28b627cbe6f8bd1da4321c1329cbc1bde498d
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2019-11-27 09:18:33 +00:00
lejeune quentin 52d4ada230 [IMP] point_of_sale: Add support of RPI 4
With this PR we can use the IoT Box with the new Raspberry Pi 4 B
using raspbian 'Buster'

With buster we remove the kiosk mode of firefox and
replace this mode with a fullscreen view of firefox.
To do that we adapt DisplayDriver to expend window with a 'call_xdotool(F11)'

We remove postgresql and patch 'odoo/odoo/http.py' for he does not return a DB.

Task id: 2089286

closes odoo/odoo#40292

X-original-commit: d20676b69f37905c7994b3c55cb1bb6dfda3460e
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-11-14 15:59:36 +00:00
lejeune quentin 3942308bc4 [FIX] iot: Fix support of device with protocol 0
The self don't contain 'interface_protocol'.
The 'interface_protocol' is in self.dev because we add this in 'supported' function.

closes odoo/odoo#40132

X-original-commit: 6963a016385c4310dd547ae2d0d7e1d5cb4fab67
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-12 14:09:07 +00:00
lejeune quentin daf42498d3 [IMP] iot: Add support for scanner without protocol
closes odoo/odoo#40044

X-original-commit: 98f48141419c81102c820929206299c80790dfc7
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-08 14:45:11 +00:00
Antoine Prieels c2e645f45f [FIX] hw_drivers: Add manufacturer to scales
At the moment the weight is read from all scales automatically. The
problem is that Adam scales beep every time we read the weight, making
them almost unusable in a shop. We set the manufacturer on the IoT
Device to be able to identify those scales and get the weight manually
instead of reading it automatically.

closes odoo/odoo#39107

Taskid: 2089995
X-original-commit: 5bde93951b29c18d8361bd5ca759a8b2e190573a
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-10-21 09:57:15 +00:00
Antoine Prieels 86ae57b479 [FIX] iot: DisplayDriver load_url error
We didn't check the status of the response of the server when getting
the url of the display. If the status was different from 200, we tried
to use the error response as URL.

closes odoo/odoo#38554

X-original-commit: 8854f910f5ac7ab5d2dfd0f51f3249a068d40885
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-10-11 22:36:16 +00:00
lejeune quentin 5d7e0b3735 [IMP] hw_drivers: Change version of IoT Box
We update the version of the build for IoT Box

closes odoo/odoo#38328

X-original-commit: be464a3759a4fe395334a1b26b90f7395e031d1a
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-10-10 06:31:41 +00:00
lejeune quentin 59173b6569 [FIX] hw_drivers: Fix for Customer display
When a box was unable to reach the Odoo server the customer display
show a white screen.

With this fix we show the default POS Client display with IP address

closes odoo/odoo#38315

X-original-commit: 290c2be72cd8305fbf8093d782604e8b0f4a80c4
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-10-10 06:26:38 +00:00
Victor Feyens 07631a5185 [IMP] * : manifest module categories cleanup
closes odoo/odoo#35754

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-25 14:03:45 +00:00
Antoine Prieels d8a2cf04bd [FIX] hw_drivers: xlib encoding with keysyms
In KeyboardUSBDriver, we use xlib to translate keysyms. The encoding
of returned chars is now utf-8. We don't need to treat special
characters differently anymore.
2019-09-19 07:44:55 +00:00
Antoine Prieels 37bdade9a2 [IMP] hw_drivers: Add manufacturer on IoT Devices
Add the possibility to set a manufacturer on IoT Devices.

closes odoo/odoo#36748

Taskid: 2062227
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-09-19 06:01:08 +00:00
Antoine Prieels 7cb540b485 [REM] hw_drivers: Remove printers list from status
The status returned bby PrinterDriver contained a list of connected
printers to be used in Enterprise, to determine if the printer that was
selected in POS Config was used in the POS. We now read this status
from the db and we therefore don't need this anymore.

In Community the user only needs to know if there's a printer connected
to the Box. We just have to know if any printer is present.

TaskID: 1970884
2019-09-17 08:31:32 +00:00
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 9fff495927 [FIX] hw_drivers: Fix get_wifi_essid helper
The `get_wifi_essid` function was moved to the helpers file, but the
`self` argument was not removed from the function's signature.

closes odoo/odoo#36710

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-09-11 13:47:36 +00:00
Antoine Prieels 0bf6fb0519 [FIX] hw_drivers: Display slowed IoT Box down
In DisplayDriver, we setup a loop to refresh the display every minute
if the url shown is not the customer display. If the customer display
was used, the loop didn't wait a minute and looped indefinitely,
without sleeping. This slowed down the whole box and explains why
receipts took a long time to print with older versions of Odoo and why
the framerate of the curomer display was so low.

closes odoo/odoo#36670

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-09-11 08:38:36 +00:00
lejeune quentin d4fa24c2bc [IMP] hw_drivers: Add possibility to choose a wifi network on IoT Box
Previously if you are wired connected we don't scan wifi network.

Now we scan the wifi network and add possibiliyt to select a network and use them.
2019-09-10 14:14:27 +00:00
lejeune quentin 9c10d7a28e [FIX] hw_drivers: Fix unmount of cups folder
To add or modify printer the /root_bypass_ramdisks/etc/cups/ need be writeable.
And /root_bypass_ramdisks/etc/cups/ = /etc/cups/
But when we make 'sudo mount -o remount,ro /' we put the /etc/cups/ and so
/root_bypass_ramdisks/etc/cups/ folder on read-only.

After all 'read-only' command we make another command to put cups folder writeable
2019-09-10 14:14:27 +00:00
lejeune quentin d098981b46 [FIX] hw_drivers: Use helper for Keyboard driver
We have implemented helpers that are not used in the KeyboardUSBDriver
2019-09-10 14:14:14 +00:00
Antoine Prieels dc4090a3b4 [FIX] hw_drivers: Status of network printers in POS
When selecting a network printer in the POS the status of the proxy
showed "Printer Disconnected" because the list returned by the driver
only contained USB printers.
2019-09-03 13:51:30 +00:00
Antoine Prieels 70006311d0 [IMP] hw_drivers, hw_posbox_homepage: get_ssid helper
Create a helper to get the ssid of the wifi to which the Box is
connected.
2019-09-04 13:10:03 +00:00
Antoine Prieels 98bebfbfa5 [IMP] point_of_sale: Per device screen_url
The screen URL is not linked to the Box anymore but to the Device.
We don't need to fetch a screen_url at the boot, it'll be done inside
each device.

TaskID: 1893493
2019-09-04 13:08:12 +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
Antoine Prieels f918003028 [FIX] hw_drivers: Setup IoT Box
The setup of IoT Boxes failed since the merge of the task about
barcode scanners: odoo/odoo#35084

We tried to get the list of available keyboard layouts from the IoT
Box. The request was sent from the server, which cannot reach the Box
because it's not located on the same server.

We now perform this task the other way around. When a device of type
printer is created on the Box, we send the list of available layouts
to the server.

TaskID: 1961025

closes odoo/odoo#35925

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-08-21 14:43:03 +00: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 26a5df9507 [IMP] hw_drivers: Save keyboard layout in config file
When a user selects a keyboard layout, we save it to a file. This is
needed to keep the selected layout after a reboot of the box.

TaskID: 1961025
2019-08-13 15:35:38 +02:00