Skip to content
Snippets Groups Projects
Commit f7edddf3 authored by Thomas Walzer's avatar Thomas Walzer
Browse files

First notes on working with AGL

parents
Branches
No related tags found
No related merge requests found
# Audio on AGL
You could use aplay (alsaplay) and arecord (alsarecord) to test your audio devices if they are not working out of box.
```
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC280 Analog [ALC280 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
```
For example the ALC280 Analog of the system is card **1** and device **0**
`aplay -c 2 --device="plughw:1,0" /dev/random`
you should here some noise on your speaker.
If that is working you can modify `/etc/wireplumber/wireplumber.conf`
with your numbers
```
load-module C libwireplumber-module-simple-policy {
"default-playback-device": <"hw:1,0">,
"default-capture-device": <"hw:1,0">,
"role-priorities": <{
```
after that `chsmack -a '_' /etc/wireplumber/wireplumber.conf` and `reboot`
\ No newline at end of file
# CAN-Bus on AGL
CAN-bus can be used with the **[agl-service-can-low-level][1]** .
Therefore a CAN bus device must be attached e.g. a virtual (vcan) or a serial (slcan).
To enable a virtual can device use following commands
```
modprobe vcan
ip link add vcan0 type vcan
ip link set vcan0 up
```
To enable a virtual can device use following commands
```
/sbin/modprobe slcan;
/usr/bin/slcan_attach -f -s5 -o /dev/ttyACM0;
/usr/bin/slcand ttyACM0 slcan0;
/sbin/ifconfig slcan0 up
```
that could although be done with a service-file in /lib/systemd/system
After that you are able to use the commands
```
candump CANDEVICE(vcan0 | slcan0) // print the messages on canbus
cangen CANDEVICE(vcan0 | slcan0) // generate random messages on canbus
cansend CANDEVICE(vcan0 | slcan0) 123#DEADBEEF // send a specific message with id#bytes
```
For the right mapping for the agl-service-can-low-level you need a file /etc/dev-mapping.conf with :
```
; Default CAN device mapping
; Format has to follow ini rules key="value", notice " around value.
[CANbus-mapping]
hs="slcan0"
ls="slcan0"
```
according with your candevice.
By entering the following command attention for the right version, you could check that with `afm-util list -a `
```
afm-util detail agl-service-can-low-level@8.0
```
you should get following information and we are interrested in the **http-port** :
```
{
"description":"Expose CAN Low Level APIs through AGL Framework",
"name":"agl-service-can-low-level",
"shortname":"",
"id":"agl-service-can-low-level@8.0",
"version":"8.0.0-3977705",
"author":"Romain Forlot <romain.forlot@iot.bzh>",
"author-email":"",
"width":"",
"height":"",
"icon":"/var/local/lib/afm/applications/agl-service-can-low-level/8.0/icon.png",
"http-port":31022
}
```
After that you should be able with `afb-client-demo --human 'IPADRESS:31022/api?token=HELLO&uuid=magic' ` to connect to the serice.
There you could use the following commands [AGL Docs CAN][2] :
```
low-can list // to get a list of all messages
low-can subscribe {"event": "*"} // subscribe to all messages
low-can auth // authorize writing
low-can write { "signal_name": "hvac.temperature.left", "signal_value": 2} //send can message
low-can write { "signal_name": "hvac.temperature.average", "signal_value": 2} // send can message
```
The upper sequence should give you json messages back.
[1]: https://git.automotivelinux.org/apps/agl-service-can-low-level/about/
[2]: https://docs.automotivelinux.org/docs/en/master/apis_services/reference/signaling/5-Usage.html
\ No newline at end of file
[Unit]
Description=SocketCAN serial interface slcan0 with a baudrate of 250000
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/modprobe slcan ; /usr/bin/slcan_attach -f -s5 -o /dev/ttyACM0 ; /usr/bin/slcand ttyACM0 slcan0 ; /sbin/ifconfig slcan0 up
ExecReload=/sbin/ifconfig slcan0 down ; /sbin/ifconfig slcan0 up
ExecStop=/sbin/ifconfig slcan0 down
[Install]
WantedBy=multi-user.target
# Display
If you want to rotated the display you could do that in the file `/etc/xdg/weston/weston.ini`
```
[output]
name=eDP-1
transform=270
```
you can find the name of your display in `/run/platform/display/weston.log`
```
[13:31:25.343] DRM: head 'eDP-1' found, connector 69 is connected, EDID make 'SEC', model 'unknown', serial 'unknown'
[13:31:25.343] DRM: head 'DP-1' found, connector 76 is disconnected.
[13:31:25.344] DRM: head 'HDMI-A-1' found, connector 84 is disconnected.
```
\ No newline at end of file
README.md 0 → 100644
# Boards
These boards were tested and the features are working:
## Surface Pro2
Image :
agl-devel agl-demo agl-html5
| Feature | Software | Hardware |
| --- | --- | ---|
| CAN | slcan | USBtin|
| Audio | pipewire | internal|
| Display | | internal eDP1 |
| Touch | | internal |
| Radio | rtl-sdr | Realtek RTL2832U |
| Bluetooth | | internal |
On the Surface there is a USB-hub attached with a USB stick with AGL, a RTL-SDR and USBtin as CAN-Bus connector.
Feature test:
| Feature | Working | Problems |
| --- | --- | --- |
| Radio | yes | - |
| Phone | parts | Microfon is not working |
| Multimedia | yes | - |
| Browser | yes | -|
## Raspberry Pi 3
Image :
agl-devel agl-demo agl-html5
| Feature | Software | Hardware |
| --- | --- | ---|
| CAN | slcan | USBtin|
| Audio | pipewire | internal|
| Display | | HDMI / DSI |
| Touch | | non / internal |
| Radio | rtl-sdr | RTLXXX |
| Bluetooth | | internal |
Feature test:
| Feature | Working | Problems |
| --- | --- | --- |
| Radio | - | - |
| Phone | - | - |
| Multimedia | - | - |
| Browser | - | -|
## Raspberry Pi 4
Image :
agl-devel agl-demo agl-html5
| Feature | Software | Hardware |
| --- | --- | ---|
| CAN | slcan | USBtin|
| Audio | pipewire | internal|
| Display | | HDMI (ex) |
| Touch | | - |
| Radio | rtl-sdr | RTLXXX |
| Bluetooth | | internal |
Feature test:
| Feature | Working | Problems |
| --- | --- | --- |
| Radio | - | - |
| Phone | - | - |
| Multimedia | - | - |
| Browser | - | -|
## Up²
Image :
agl-devel agl-demo agl-html5
| Feature | Software | Hardware |
| --- | --- | ---|
| CAN | slcan | USBtin|
| Audio | pipewire | internal|
| Display | | HDMI (ex) |
| Touch | | USB (ex) |
| Radio | rtl-sdr | RTLXXX |
| Bluetooth | | external |
Feature test:
| Feature | Working | Problems |
| --- | --- | --- |
| Radio | - | - |
| Phone | - | - |
| Multimedia | - | - |
| Browser | - | -|
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment