cancel
Showing results for 
Search instead for 
Did you mean: 

stm32mp157-dk2 printer support

Alex Mach
Associate III

Hello,

How to install a USB printer support? I've tried apt-get install cups but this no work.

Thanks,

Alex.

2 REPLIES 2
Jean-Marc B
ST Employee

Hi @Alex M.ach​ 

Indeed, the cups package is not shipped into the OpenSTLinux repository because of some installation errors that corrupt the dpkg database.

Could you tell me which ecosystem (v1.2, v2.0, v2.1 or v3.0) you are using please so I can try to make some attempts?

Best regards

--JM

Jean-Marc B
ST Employee

Hello @Alex M.ach​ 

I just updated the OpenSTLinux distributions V3.0 and V2.1 so the cups package is now available.

These are the commands to perform on your board.

Firstly, you need to update the package database:

root@stm32mp1:~# apt-get update
 
The software package is provided AS IS, and by downloading it, you agree to be
bound to the terms of the software license agreement (SLA).
The detailed content licenses can be found at
https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
 
Get:1 http://packages.openstlinux.st.com/3.0 dunfell InRelease [3458 B]
Get:2 http://packages.openstlinux.st.com/3.0 dunfell/main armhf Packages [1005 kB]
Get:3 http://packages.openstlinux.st.com/3.0 dunfell/updates armhf Packages [29.0 kB]
Get:4 http://packages.openstlinux.st.com/3.0 dunfell/untested armhf Packages [1439 kB]
Fetched 2477 kB in 8s (293 kB/s)
Reading package lists... Done

You can check the cups package is available :

root@stm32mp1:~# apt-cache policy cups
cups:
  Installed: (none)
  Candidate: 2.3.1-r1
  Version table:
     2.3.1-r1 500
        500 http://packages.openstlinux.st.com/3.0 dunfell/updates armhf Packages

You can now install it:

root@stm32mp1:~# apt-get install cups
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libcups2
The following NEW packages will be installed:
  cups libcups2
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 4757 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://packages.openstlinux.st.com/3.0 dunfell/updates armhf libcups2 armhf 2.3.1-r1 [184 kB]
Get:2 http://packages.openstlinux.st.com/3.0 dunfell/updates armhf cups armhf 2.3.1-r1 [4573 kB]
Fetched 4757 kB in 2s (2309 kB/s)
 
The software package is provided AS IS, and by downloading it, you agree to be
bound to the terms of the software license agreement (SLA).
The detailed content licenses can be found at
https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
 
Selecting previously unselected package libcups2.
(Reading database ... 14057 files and directories currently installed.)
Preparing to unpack .../libcups2_2.3.1-r1_armhf.deb ...
Unpacking libcups2 (2.3.1-r1) ...
Selecting previously unselected package cups.
Preparing to unpack .../cups_2.3.1-r1_armhf.deb ...
Running groupadd commands...
NOTE: cups: Performing groupadd with [ --system lpadmin]
Unpacking cups (2.3.1-r1) ...
Setting up libcups2 (2.3.1-r1) ...
Setting up cups (2.3.1-r1) ...
Created symlink /etc/systemd/system/sockets.target.wants/org.cups.cupsd.socket -> /lib/systemd/system/org.cups.cupsd.socket.
Created symlink /etc/systemd/system/multi-user.target.wants/org.cups.cupsd.path -> /lib/systemd/system/org.cups.cupsd.path.
Created symlink /etc/systemd/system/printer.target.wants/org.cups.cupsd.service -> /lib/systemd/system/org.cups.cupsd.service.
Created symlink /etc/systemd/system/sockets.target.wants/org.cups.cups-lpd.socket -> /lib/systemd/system/org.cups.cups-lpd.socket.

You can now run some tests to check the package is well installed:

root@stm32mp1:~# apt-cache policy cups
cups:
  Installed: 2.3.1-r1
  Candidate: 2.3.1-r1
  Version table:
 *** 2.3.1-r1 500
        500 http://packages.openstlinux.st.com/3.0 dunfell/updates armhf Packages
        100 /var/lib/dpkg/status
		
root@stm32mp1:~# systemctl list-unit-files | grep cups
org.cups.cupsd.path                    enabled
org.cups.cups-lpd@.service             static
org.cups.cupsd.service                 enabled
org.cups.cups-lpd.socket               enabled
org.cups.cupsd.socket                  enabled
root@stm32mp1:~# systemctl status org.cups.cupsd.service
[[0;1;32m*[[0m org.cups.cupsd.service - CUPS Scheduler
     Loaded: loaded (/lib/systemd/system/org.cups.cupsd.service; enabled; vendor
 preset: enabled)
     Active: [[0;1;32mactive (running)[[0m since Fri 2021-04-09 15:21:56 UTC; 54
s ago
TriggeredBy: [[0;1;32m*[[0m org.cups.cupsd.path
             [[0;1;32m*[[0m org.cups.cupsd.socket
       Docs: man:cupsd(8)
   Main PID: 1667 (cupsd)
     Memory: 664.0K
     CGroup: /system.slice/org.cups.cupsd.service
             `-1667 /usr/sbin/cupsd -l
 
Apr 09 15:21:56 stm32mp1 systemd[1]: Started CUPS Scheduler.
root@stm32mp1:~# systemctl status org.cups.cupsd.socket
[0;1;32m*[[0m org.cups.cupsd.socket - CUPS Scheduler
     Loaded: loaded (/lib/systemd/system/org.cups.cupsd.socket; enabled; vendor
preset: enabled)
     Active: [[0;1;32mactive (running)[[0m since Fri 2021-04-09 15:21:56 UTC; 1m
in 17s ago
   Triggers: [[0;1;32m*[[0m org.cups.cupsd.service
     Listen: /run/cups/cups.sock (Stream)
     CGroup: /system.slice/org.cups.cupsd.socket
 
Apr 09 15:21:56 stm32mp1 systemd[1]: Listening on CUPS Scheduler.
root@stm32mp1:~# lpstat -r
scheduler is running
root@stm32mp1:~# lpstat -d
no system default destination
root@stm32mp1:~# netstat -nl | grep 631
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
tcp        0      0 ::1:631                 :::*                    LISTEN

By following this reference : https://wiki.stmicroelectronics.cn/stm32mpu/wiki/How_to_install_a_simple_web_browser to install a light browser, you can launch the cups web interface:

root@stm32mp1:~#  python3 web_browser.py http://localhost:631/admin

If your problem is resolved, please mark my reply as «Best answer»

Best regards,

--JM