Screen mirroring using GNU Emacs


Screen mirroring using GNU Emacs from Debian XFCE to LG UJ632T

 

Note: Don't forget to quit properly (or use wpa_cli p2p_cancel). Else your computer will continue to scan for peers in the background.

Config

(require 'tv)
(setq wfd-wpa-cli "/usr/sbin/wpa_cli")

 

Code

https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/tv.el
https://gitlab.com/atamariya/hostap/-/blob/tools/wpaspy/wfd.py (RTSP server)
 

Setup

We need to be able to run wpa_cli and nmcli as a normal user. Hence we will add the user and the tools to netdev group.
 
- Edit /usr/lib/systemd/system/wpa_supplicant.service (as root)
ExecStart=/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant -G netdev

 

- Restart wpa_supplicant (as root).

systemctl daemon-reload
service wpa_supplicant restart 

 

- Modify user group, file permissions and path.

sudo adduser <username> netdev
chown -R :netdev /usr/sbin/wpa_cli /var/run/wpa_supplicant/*
export PATH=/usr/sbin:$PATH 
 
- Start the RTSP server.
python3 wfd.py
 
- Find peer devices
wpa_cli p2p_find
wpa_cli p2p_peers
 
- Add a connection for peer and connect.
p2p-dev-wlp2s0 is the P2P device interface. Use nmcli dev to find the
               right value. The value to use is the device name of
               type wifi-p2p.
7c:1c:4e:ee:ab:9e is the peer device. 
nmcli con add con-name eth2 type wifi-p2p ifname p2p-dev-wlp2s0 \
 ipv4.method auto peer 7c:1c:4e:ee:ab:9e \
 wifi-p2p.wfd-ies 00000600901C4400C8
 
nmcli dev connect p2p-dev-wlp2s0

 

-  This should start the streaming.

 

 

Comments

Popular posts from this blog

GNU Emacs as a Comic Book Reader

Data Visualization with GNU Emacs

Tinylisp and Multi-threaded Emacs