Closed shir0tetsuo closed 9 months ago
I've not seen this as an issue. Are you sure you are connecting to the OTG port. Only one of them provides power and data lanes. The other only provides power. In every test I've done, OTG USB connectivity is available right out of the box.
Yes, the OTG data port (middle port) is being used. I assume that it's doing something, but Ubuntu doesn't like it for some reason?
By the way, I'll note that my network is 10.0.0.* 255.255.255.0 as well, maybe that is conflicting with the connection. Is there a way to force a specific IP on the device from the Micro SD directly? That may work.
By the way, I'll note that my network is 10.0.0.* 255.255.255.0 as well, maybe that is conflicting with the connection. Is there a way to force a specific IP on the device from the Micro SD directly? That may work.
Oh it might be interfering. See the original instructions here from evilsocket. I wonder if you're getting a conflict because your network matches the network pwnagotchi tries to set up locally.
I have run the linux connection script, however over time the connection drops automatically by whatever Ubuntu thinks is right, I believe being not connected to my local network may open up a window for SSH login; I think the first thing I'll try to do with it is change the default IP address on the device.. Finicky at best but now there is possibility of connecting. Will have to come back with updated progress
By the way, I'll note that my network is 10.0.0.* 255.255.255.0 as well, maybe that is conflicting with the connection. Is there a way to force a specific IP on the device from the Micro SD directly? That may work.
Oh it might be interfering. See the original instructions here from evilsocket. I wonder if you're getting a conflict because your network matches the network pwnagotchi tries to set up locally.
After messing around for a little while I came up with a working solution. This might be useful infos for other people having similar issues being on the same network config I have being 10.0.0.0/24 on my home network:
#!/usr/bin/env bash
set -e
USB_IFACE=${1:-enxfec40b5b3a66} USB_IFACE_IP=10.0.0.1 USB_IFACE_NET=10.0.0.0/24
UPSTREAM_IFACE=${2:-enp4s0}
ip addr add "$USB_IFACE_IP/24" dev "$USB_IFACE" ip link set "$USB_IFACE" up
iptables -A FORWARD -o "$UPSTREAM_IFACE" -i "$USB_IFACE" -s "$USB_IFACE_NET" -m conntrack --ctstate NEW -j ACCEPT iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -t nat -F POSTROUTING iptables -t nat -A POSTROUTING -o "$UPSTREAM_IFACE" -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward echo "The process completed successfully. Made changes to ip and iptables."
4. SSH into the device with 10.0.0.2 (or hostname.local).
5. Reconfigure the usb0 connection expecting a disconnect (at /etc/network/interfaces.d/usb0-cfg )
allow-hotplug usb0 iface usb0 inet static address 10.0.1.2 netmask 255.255.255.0 network 10.0.1.0 broadcast 10.0.1.255 gateway 10.0.1.1 metric 20
sudo ifconfig usb0 10.0.1.2 netmask 255.255.255.0
7. (On Ubuntu host machine):
```bash
#!/usr/bin/env bash
set -e
# name of the ethernet gadget interface on the host
USB_IFACE=${1:-enxfec40b5b3a66}
USB_IFACE_IP=10.0.1.1
USB_IFACE_NET=10.0.1.0/24
# host interface to use for upstream connection
UPSTREAM_IFACE=${2:-enp4s0}
ip addr add "$USB_IFACE_IP/24" dev "$USB_IFACE"
ip link set "$USB_IFACE" up
iptables -A FORWARD -o "$UPSTREAM_IFACE" -i "$USB_IFACE" -s "$USB_IFACE_NET" -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o "$UPSTREAM_IFACE" -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "The process completed successfully. Made changes to ip and iptables."
The device can now be pinged/connected while also simultaneously being connected to the internet.
I have resolved my connection issues please see the above for details :+1:
Describe the bug No connectivity between device and computer (USB).
To Reproduce Steps to reproduce the behavior:
Expected behavior Device begins communicating with main Ubuntu machine.
Environment (please complete the following information):
I was wondering if maybe there's something I can do with the configuration files to enable a Bluetooth connection or something. Let me know of any solutions, also, I am afraid to power off my device simply by pulling the power cable out, haha..