WirelessAndroidAutoDongle icon indicating copy to clipboard operation
WirelessAndroidAutoDongle copied to clipboard

SSH is not available as per documentation

Open markleigh opened this issue 7 months ago • 15 comments

When connected via wi-fi, and having enabled ssh in the config file, SSH should be available at 10.0.0.1 with username root and password password. I suspect this is an error with the documentation, rather than a bug. SSH at 10.0.0.1 just times out. The device is visible on the network at 10.0.0.1, and responds to pings, but does not respond to SSH requests. Presumably SSH is running on a non-standard port, but I've been unable to discern which Port it is on. If anyone knows, could it please be added to the documentation so we can get log files?

markleigh avatar Apr 24 '25 16:04 markleigh

It should be running on standard 22 port. The only difference lastly is the need to explicitly enable SSH: https://github.com/nisargjhaveri/WirelessAndroidAutoDongle/commit/b53837749e471e1ae0fe307e807169bf4bc335fd#diff-4fc2d2de2ce5e47497c650abca903a40b191192607ca914244b77dd2ed0e07c3R34

manio avatar Apr 24 '25 17:04 manio

As noted, SSH is enabled in the config file. Is there somewhere else at SSH has to be enabled in order for it to work? If not I guess there's a bug, and I can't provide logs because I can't SSH.

markleigh avatar Apr 24 '25 17:04 markleigh

I access with ssh [email protected] without specify any port The issus is to uncomment in the aawgd.conf the SSH key and the wifi password to fix the same during the debug process

Ioniq3 avatar Apr 24 '25 17:04 Ioniq3

@markleigh Maybe you are trying to connect while the androidauto is running? You need to disconnect android auto, disable bluetooth for short while and then make explicit connection to the WiFi dongle...

manio avatar Apr 24 '25 17:04 manio

@markleigh Maybe you are trying to connect while the androidauto is running? You need to disconnect android auto, disable bluetooth for short while and then make explicit connection to the WiFi dongle...

Yes, Bluetooth disabled, wifi connected to the pi (it remains connected after disabling Bluetooth), and still no SSH.

markleigh avatar Apr 24 '25 17:04 markleigh

Was it working for you before at some point? Maybe this is some more general problem of ssh client, firewall or something? I didn't have any problems connecting...

manio avatar Apr 24 '25 18:04 manio

As the last resort you can try to connect your Pi via HDMI to some display, attach a keyboard and investigate via console what is going on... if dropbear is running, etc...

manio avatar Apr 24 '25 18:04 manio

Was it working for you before at some point? Maybe this is some more general problem of ssh client, firewall or something? I didn't have any problems connecting...

SSH has never worked. Android auto sometimes works temporarily. Is there any way to persist logs via conf file so that I can just pull logs off the SD card?

markleigh avatar Apr 24 '25 18:04 markleigh

Delete /etc/default/dropbear By this you don't need change the aawgd.conf

Ioniq3 avatar Apr 24 '25 19:04 Ioniq3

Thanks @manio; I tried your rust version but it doesn't even broadcast a wifi access point, so I can't even start android auto (or SSH into it either). Also (off topic, I know) but your image will only connect to the bluetooth about one in 10 times. I'll try yours again without modifying the conf file to see if it even works as an android auto device, and then try Nisarg's again.

jebbgrenham avatar Apr 25 '25 23:04 jebbgrenham

Getting back on topic... I tried a new flash; additionally un-commenting the wifi password line and setting "1234" as password (instead of just relying on the BT authentication to connect the wifi) and now the unit doesn't even broadcast a wifi AP (same occurred with Manio's version).

jebbgrenham avatar Apr 26 '25 00:04 jebbgrenham

Delete /etc/default/dropbear By this you don't need change the aawgd.conf

This will disable SSH I assume, but you're saying this will persist logs? This will be my next try if this 5th re-flash also doesn't work.

jebbgrenham avatar Apr 26 '25 01:04 jebbgrenham

Marking this closed. Not because it's truly fixed (there's clearly numerous bugs), but with huge frustration I was able to get a copy of the logs.

After 5 or 6 SD flashes, and NOT modifying the conf file WiFi password (but un-commenting it), definitely un-commenting the SSH line in conf file, waiting for it to randomly disconnect, then disabling Bluetooth, then manually connecting WiFi using the default password, I was able to make an SSH connection before the WiFi drops out (about 8 seconds later, every time). After many practice runs of quickly connecting the WiFi, switching to SSH client, quickly connecting, typing out "cat /var/log/messages" (there's no bash history apparently...) and then exporting the SSH session to a file all within 8 seconds before the WiFi disconnects, I FINALLY managed to get the log off.

The quick fix here is persisting the logs and using log rotation to not fill the SD card. Someone will be able to fix this easily.

Edit: Apparently I can't close this. It should probably be fixed (SSH not being enabled when set in .conf, the lack of ability to set a WiFi password, the 8 seconds WiFi alive time to do all your troubleshooting, the non-persistent logs) but those are really 4 separate issues that aren't all related to the original issue.

jebbgrenham avatar Apr 26 '25 03:04 jebbgrenham

Thanks @manio; I tried your rust version but it doesn't even broadcast a wifi access point, so I can't even start android auto (or SSH into it either). Also (off topic, I know) but your image will only connect to the bluetooth about one in 10 times. I'll try yours again without modifying the conf file to see if it even works as an android auto device, and then try Nisarg's again.

It is really weird. I have an AP every time the RPi starts and I also don't remind this kind of problems users reported me... Anyway - as always I cannot tell you more without the logs :( Maybe this is related with your connectivity problems you reported in #267... no idea... Also IIRC your Sony HU needs legacy flags for working properly with my project, Nisarg's has this enabled by default.

manio avatar Apr 26 '25 09:04 manio

I was able to make an SSH connection before the WiFi drops out (about 8 seconds later, every time). After many practice runs of quickly connecting the WiFi, switching to SSH client, quickly connecting, typing out "cat /var/log/messages" (there's no bash history apparently...) and then exporting the SSH session to a file all within 8 seconds before the WiFi disconnects, I FINALLY managed to get the log off.

A small tip here: This is a known issue also for me. I think the problem here is when you disable AA in your phone, the Raspberry is still trying to connect to your phone via Bluetooth, but the problem here is that BT and WiFi is interfering (I have a plenty of unanswered pings during that time - because bluetooth connecting seems really "heavy" operation for the bundled BT/WiFi communication chip, especially when target BT device is unavailable). So to avoid this: after you are able to connect, the first thing I am doing is stopping aawgd/aa-proxy-rs - otherwise it may lead to disconnecting SSH session. I have the sh history saved in /root/ so it is much easier to type CTRL-R and command fragment. Depending on ssh client on your phone you can also set initial command set which it is executing upon connect... it's also making things easier.

manio avatar Apr 26 '25 10:04 manio