I am trying to setup VICE to open a local pseudo-terminal for the userport RS232 interface, that I can connect to e.g. with a terminal program.
I am using this command line:
x64sc -rsuserup9600 -rsuserbaud 9600 -rsuserdev 3 -rsdev2 "|socat - PTY,link=/tmp/viceser"
When I run "socat in the way given here outside VICE, the pseudo terminal is created under /tmp/viceser. When I start VICE with it, it is not created.
Also, after starting, when I look into the settings, I see that:
- neither the ACIA nor the Userport RS2332 setting is enabled.
- The device is not set to 2 but to 4
When I change that in the VICE settings, the console log shows
"RS232DEV: Error - Attempted to get status of invalid fd -16385"
Do you have any idea what happens?
This is on Mint Linux 21.1 (based on ubuntu debian), with a GTK3 build of VICE.
Note that when I change the settings in VICE, save the settings and start
x64sc
without command line settings, the settings in VICE are ok - but the /tmp/viceser pty is still not created
Try setting it up in the menus, then quit VICE and look at the log - it will output the commandline required to reproduce those settings. Here i get this:
-default -rsdev2 "|socat - PTY,link=/tmp/viceser" -rsdev2baud "9600" -rsuserup9600 -rsuserbaud "9600" -rsuserdev "1" -userportdevice "2"
No idea about that pseudoterminal, i wouldnt know how test it (or the UP9600 stuff for that matter).
It says to use
-default -rsdev2 "|/usr/bin/socat - PTY,link=/tmp/viceser" -rsdev2baud "9600" -rsuserup9600 -rsuserbaud "9600" -rsuserdev "1" -userportdevice "2"
But when I run it with this command it says in the log
RS232NET: Error - Cant open connection.
At least that is the only RS232 related log entry I could find. All "IP232" checkmarks are NOT checked. I wonder why it has the "NET" in "RS232NET"?
It seems it is unable to execute a command to pipe serial input/output to it. But that used to worked before.
Is there, in the meantime, another way of letting VICE act as a pseudo tty device, so I could connect to its RS232 emulation from the outside e.g. with a "miniterm" terminal program?
I don't see that error in the log shrug How exactly are you testing this?
The piping should work fine, at least it did a while ago when i tried it with netcat.
You could also try to create a "named pipe" device node and use that - but dont ask me how that worked, last time i did this was 25 years ago :)
I tried it again on another machine (kubuntu 22.04.2 LTS this time) with
x64sc -default -rsdev2 "|socat - PTY,link=/tmp/viceser" -rsdev2baud "9600" -rsuserup9600 -rsuserbaud "9600" -rsuserdev "1" -userportdevice "2"
and get the same RS232NET error.
When you test that command line, does /tmp/viceser get created?
Sorry, i must have done something wrong before, i also see the error now....
i found out what the problem is... apparently some time around r20291 Spiro made a subtle change to the behaviour when there is a pipe in the address: it tries to create a unix domain socket then.
Since this was not documented, and its much preferable that this works the same in both windows and unix, i commented out that code. I also enabled some more log messages for the time being.
Try r43721 - this restores the old (and documented) behaviour. Looks like it is working for me too (at least the /tmp/viceser file is created, and i dont see errors in the log)
Please let me know if that makes it work for you, so i can disable the extra messages again
I'm testing r43721, it seems to be working fine, I tried connecting both Putty and another instance of x64sc using /temp/viceser as the serial device and got bidirectional comms no problem.
This method using a pseudo-TTY is less convoluted and error prone than the socat method currently listed in the wiki.
If everything works maybe we must add this to the wiki.
Last edit: Durandal 2023-04-28
Actually, the regular documentation should be updated instead - the Wiki is never the right place to put non temporary info :)
That said, the socat line could probably replace the default setting for device #4 (which uses netcat to connect an IP - which is kindof pointless, now that windows and linux both support directly connecting to and IP and piping to a process)
At least it creates the /tmp/viceser link to the pty. Will check tomorrow if my full test works (running Serial Line IP over that :-)
I tried it. so far it seems:
- flakey when autoload is enabled. I.e. when after the commands above I add "osa.d64" it most of the time does not work
- seems to run socat when autostart is disabled, i.e. I add "-8 osa.d64"
Still, I don't get any communication. Not sure if it is my OS/driver, or in the emulator. I am looking for a C64 terminal program that supports the 9600 baud interface to test it
Last edit: Andre Fachat 2023-04-29
It probably makes sense to test those things seperately. For example do NOT use "UP9600" before you got regular Userport RS232 working - the UP9600 emulation itself is probably not well tested and who knows if it even works right. I'd also not use autostart at all until you got it working without.
(The only "terminal program" i have seen that can use it is the original "miniterm" released by daniel dallmann)
miniterm seems to work just fine. So I guess I have to check my code now.
so can we close this? :)
closing due to no feedback