rodizio1 / EZ-WifiBroadcast

Affordable Digital HD Video Transmission made easy!
GNU General Public License v2.0
817 stars 200 forks source link

Need WIFI_HOTSPOT as transmitter #85

Closed neilyoung closed 6 years ago

neilyoung commented 6 years ago

I need WIFI_HOTSPOT functionality as transmitter. As far as I can see in /root/.profile WIFI_HOTSPOT is recognized in RX mode only (which makes sense).

From /root/.profile I could extract these operations, which make the internal RaspBerry 3 Wifi a hotspot:

sudo nice mount -o remount,rw /boot
sudo ip link set intwifi0 name wifihotspot0
sudo ifconfig wifihotspot0 192.168.2.1 up
sudo ionice -c 3 nice dos2unix -n /boot/apconfig.txt /tmp/apconfig.txt
sudo nice udhcpd -I 192.168.2.1 /etc/udhcpd-wifi.conf
sudo nice -n 5 hostapd -B -d /tmp/apconfig.txt
sudo sync
sudo nice mount -o remount,ro /boot

If I issue this sequence from ssh, the hotspot is created, I can join it and get an IP. I can communicate with a process on TX via this IP. Fine.

Now I'm desperately trying to put this sequence into a start up script to no avail. Furthermore, trying to trick /root/.profile by reverting all WIF_HOTSPOT relevant limiting

if [ "$CAM" == "0" ]; then # only do relay/hotspot stuff if RX

to

if [ "$CAM" == "1" ]; then # only do relay/hotspot stuff if TX

doesn't bring the success.

Please help: What do I need to do in order to have WIFI_HOTSPOT functionality in TX mode as well?

neilyoung commented 6 years ago

There must be something happening as TX, which reverts the enforced WIFI_HOTSPOT configuration. If I ssh onto the box, the wifihotspot0 interface is "half there", it has an IP, but the access point is not working (it is not "on air").... strange...


wifihotspot0 Link encap:Ethernet  HWaddr b8:27:eb:4f:c5:4e  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
neilyoung commented 6 years ago

OK, could solve that by running the sequence in /etc/rc.local...