I tried to install websocat on Raspbian Stretch using cargo:
So I first installed Rust toolchain according the instruction:
pi@raspberrypi3BplusX:~ $ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
...
Rust is installed now. Great!
To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done automatically.
To configure your current shell run source $HOME/.cargo/env
pi@raspberrypi3BplusX:~ $
Installation went well, but cargo just did hang indefinitely.
Then I tried to compile minimal helloworld example with rustc and that hangs as well:
Try to install nightly and use rustc -Z time-passes hello.rs. Would it output anything?
Also try debugging with strace: strace -fo log rustc hello.rs. Attaching to a hung rustc with gdb and dumping threads' stacktraces may also be helpful.
"rustc -Z time-passes hello.rs" hangs as well.
I downloaded prebuilt version you pointed to, did chmod 755 and then executing "./websocat_arm-linux" hangs as well.
"strace -fo log rustc hello.rs" hangs as well, is that expected to attach gdb?
I have long experience with gdb, but never attached to running processes.
Thanks, that worked. So at least I can now use websocat on Raspbian.
But being able to use rust compiler on Raspbian would be useful -- am I really the first trying to use Rust compiler under Raspbian?
pi@raspberrypi3BplusX:~ $ wget -q https://vi-server.org/pub/websocat_1.2.0_nossl_arm_mini
pi@raspberrypi3BplusX:~ $ chmod 755 websocat_1.2.0_nossl_arm_mini
pi@raspberrypi3BplusX:~ $ ./websocat_1.2.0_nossl_arm_mini
websocat 1.2.0
Vitaly "_Vi" Shukela <vi0oss@gmail.com>
Command-line client for web sockets, like netcat/curl/socat for ws://.
USAGE:
...
See short examples and --dump-spec names for most address types and overlays with --help=doc option
websocat: No URL specified
pi@raspberrypi3BplusX:~ $
My interest in websocat was mainly driven by (ESP8266 and ESP32) MicroPython module WebREPL interface, a websocket connection listening on port 8266 and allowing a remote REPL.
I did write a Python[23] client allowing to access that interface besides the normal browser vt100 client https://micropython.org/webrepl/
Now I tried to use websocat and have partial success. I cannot filter out the command being sent over to the module being returned, but in principle it works fine (the CTRL-D at end (\x04) does a module soft reset, closes websocket connection and avoids a websocat error at the end):
pi@raspberrypi3BplusX:~ $ websocat ws://192.168.4.1:8266 < <(echo "abcd" && sleep 0.3 && echo -e "gc.mem_free()\r\n5**4**3\r\x04" && sleep 1)
Password:
WebREPL connected >>>
g
c
.
m
e
m
_
f
r
e
e
(
)
93680
>>>
5
*
*
4
*
*
3
542101086242752217003726400434970855712890625
>>>
pi@raspberrypi3BplusX:~ $
Thanks for the continued help. I have no other rust installation than the Raspbian one. I tried to download the last link, but clicking on it leads to a generic Debian page and no download ...
Are you willing to share online SSH access to that system for experimentation?
If yes, you can add ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjR3bjPcx3izHVxGxhDWzYE5VOGGcy31NsWzoDgbYVP vi to authorized_keys and publish username@IP:port here.
According to results of that ./hw runs, maybe the bug is already fixed? Try rustup update nightly and re-run rustc. Still hangs?
pi@raspberrypi3BplusX:~ $ ls -l /home/pi/.rustup/toolchains/nightly-armv7-unknown-linux-gnueabihf/bin/rustc
-rwxr-xr-x 1 pi pi 9160 Dec 18 21:17 /home/pi/.rustup/toolchains/nightly-armv7-unknown-linux-gnueabihf/bin/rustc
pi@raspberrypi3BplusX:~ $ ls -l /home/pi/.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/bin/rustc
-rwxr-xr-x 1 pi pi 9120 Nov 29 17:17 /home/pi/.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/bin/rustc
pi@raspberrypi3BplusX:~ $ ls -l /home/pi/.cargo/bin/rustc
-rwxr-xr-x 10 pi pi 9797736 Nov 29 17:50 /home/pi/.cargo/bin/rustc
pi@raspberrypi3BplusX:~ $