Deploy-and-run from PC to Beeb?

Development tools discussion area.
User avatar
sydney
Posts: 2454
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by sydney » Mon Sep 03, 2018 5:35 pm

I've been using cutecom to send my ssd's to the Master for testing but wanted something I could use from the command line.
Today I discovered writetoserial on github which is a small command line program that takes a filename, speed and port as arguments and squirts my ssd over the serial port to my UPURS enabled Master. It's great! I'll probably write a small 'deploy' script which will assemble, create an ssd and send it straight to the master all in one go.
Last edited by sydney on Mon Sep 03, 2018 6:53 pm, edited 1 time in total.

User avatar
guddler
Posts: 536
Joined: Sat Apr 04, 2009 9:43 am
Location: W.Somerset
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by guddler » Mon Sep 03, 2018 6:08 pm

Clearly this IS a very dumb question or you'd already be doing it, but if this isn't Windows (and maybe even if it is) why can't you simply copy the file to the serial port (the /dev/BLAH) from the command line? THat's what I used to do when I had a linux based serial solution on my Amiga.

There are commands that set the handshaking and transfer rate etc. for the port (again command line)

What am I missing?

User avatar
sydney
Posts: 2454
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by sydney » Mon Sep 03, 2018 6:21 pm

My linux knowledge is pretty limited and I struggled with enabling flow control and so gave up. I've read up on setserial, stty, ckermit and probably others.
Last edited by sydney on Mon Sep 03, 2018 6:22 pm, edited 1 time in total.

User avatar
guddler
Posts: 536
Joined: Sat Apr 04, 2009 9:43 am
Location: W.Somerset
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by guddler » Mon Sep 03, 2018 6:44 pm

Ah ok. Not sure if the Amiga thing was using flow control. I know you’ve found a tools now but I’ll see if I can dig it out. I remember it was a headache to work out but simple enough to repeat once you knew what to do.

VectorEyes
Posts: 265
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by VectorEyes » Mon Sep 16, 2019 12:06 am

Arise necro-thread!

Has anyone ever used UPURSFS with MacOS? Did you get it working? I think I have everything set up correctly but I find that I can't actually execute any HostFS commands (or any *commands at all, really) ... the machine just waits forever for the command to complete, but never prints any output.

I am using the recommended FTDI cable for USB->Serial at the Mac end and a UPURS cable for Serial->Userport at the Master end.

I have downloaded the UPURS ROM image and put it onto a cartridge for use in the Master.

I have *UNPLUGGED all other Filesystem ROMS, just to see whether they were conflicting with UPURSFS. But I see the same symptoms when they're plugged in.

When the serial cable is connected to the Mac, I see "HostFS:UPURS 0.03" on startup on the Master.

With the cable disconnected, I see the same, but it says "No RTS" at the end.

... So, clearly it knows that it is/isn't connected...

I am using TubeHost.pl on the Mac.

I've tried various combinations of options to run the script: -s, -U, specifying the baud rate, etc. Nothing seems to help.

For reference I'm running the following command in a terminal window:

perl ./TubeHost.pl -U /dev/tty.usbserial-FT93UCZ7 115200


Does anyone have any suggestions for what I'm doing wrong or how I might troubleshoot?

Thanks!

User avatar
sweh
Posts: 2097
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by sweh » Mon Sep 16, 2019 4:52 pm

VectorEyes wrote:
Mon Sep 16, 2019 12:06 am
perl ./TubeHost.pl -U /dev/tty.usbserial-FT93UCZ7 115200
Try using /dev/cu.usbserial.... instead.
Rgds
Stephen

VectorEyes
Posts: 265
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by VectorEyes » Mon Sep 16, 2019 10:25 pm

sweh wrote:
Mon Sep 16, 2019 4:52 pm
VectorEyes wrote:
Mon Sep 16, 2019 12:06 am
perl ./TubeHost.pl -U /dev/tty.usbserial-FT93UCZ7 115200
Try using /dev/cu.usbserial.... instead.
Thanks sweh! Sadly it didn't make any difference.

I also realised I had an old version of UPURSFS so upgraded to the latest one (0.08) but that didn't help either.

Should I see any output at all in the terminal window when I run TubeHost.pl? Currently it's completely empty which seems a little suspicious.

I'm about to try to 1. (re-)learn Perl and 2. learn how to use the Perl debugger, but if you've any other suggestions I'm all ears!

VectorEyes
Posts: 265
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by VectorEyes » Mon Sep 16, 2019 10:35 pm

Upon further investigation:

Tubehost.pl is hanging on the following line:

system("stty $BAUD crtscts ignbrk ignpar -icrnl -ixon -opost -isig -icanon -iexten -echo < $socket_path");


Would this suggest some kind of driver issue?

User avatar
MartinB
Posts: 5249
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by MartinB » Mon Sep 16, 2019 10:47 pm

I’m afraid I can’t help with UPURSFS because it wasn't my 'thing', (I’m only responsible for the original UPURS system), so I’ll have to leave the expert comment on that to Stephen (sweh). My only suggestion though if you continue to struggle would be for you to first confirm that the basic UPURS system works which would vindicate the cables etc. So, if you haven't already, could you perhaps try some simple UPURS to/from transfers using the Linux-recommended (by others - not me being a Windows person!) Cutecom ?

VectorEyes
Posts: 265
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by VectorEyes » Tue Sep 17, 2019 12:23 am

Thanks Martin. I seem to have got it working! For those who might want to try UPURSFS on MacOS in the future:

- The -U option didn't work. I had to use -s. ie:

perl ./TubeHost.pl -s /dev/tty.usbserial-FT93UCZ7 115200

- There seems to be a bug on MacOS whereby if you have the FTDI USB->Serial cable plugged in on boot, and you have installed the FTDI drivers, the default MacOS drivers sneak in first and do something which prevents the device being accessed. The solution (sigh...) is to unplug and re-plug the FTDI cable from the computer!

Now I have all kinds of problems getting UPURSFS to start as the default filesystem, but that's a problem for another day...

User avatar
Elminster
Posts: 3958
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by Elminster » Tue Sep 17, 2019 10:18 am

I don’t use UPURSFS but I do use UPURS on Mac and the cable is always plugged in (for the last 3 years) and I have 3 or 4 other FTDI device (not just UPURS) on the machine. Never had an issue with them being plugged in at boot. What MacOS version are you on?

User avatar
sweh
Posts: 2097
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by sweh » Tue Sep 17, 2019 10:58 am

VectorEyes wrote:
Mon Sep 16, 2019 10:35 pm
Upon further investigation:

Tubehost.pl is hanging on the following line:

system("stty $BAUD crtscts ignbrk ignpar -icrnl -ixon -opost -isig -icanon -iexten -echo < $socket_path");


Would this suggest some kind of driver issue?
Typically commands like that hang on serial ports if there's not the right signal asserted (eg DTR or CD). These signals are _meant_ to be ignored on opening with "cu" devices ("cu" stands for "Call Unit", and historically was the port used for "dial out", whereas "tty" was the port used for "dialin". So the getty would be in "tty" and would block until the modem asserted CD/DTR, allowing the "cu" port to be used for outgoing calls on the modem).
Rgds
Stephen

VectorEyes
Posts: 265
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by VectorEyes » Tue Sep 17, 2019 12:59 pm

Making considerable progress! I will post here with what I had to do to get things working shortly...

I'm trying to work it out by looking online but does anyone know which areas of memory (workspace) I might need to preserve when using HostFS / UPURSFS? I am trying to run a demo (Wave Runner) over UPURSFS but it's failing badly, most likely because the demo uses lots of areas of memory that it strictly shouldn't...

User avatar
myelin
Posts: 740
Joined: Tue Apr 26, 2016 9:17 pm
Location: Mountain View, CA, USA
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by myelin » Tue Sep 17, 2019 4:59 pm

Looking at my TubeHost code, I changed that line to:

system("stty -f $socket_path $BAUD crtscts ignbrk ignpar -icrnl -ixon -opost -isig -icanon -iexten -echo");

I think this made it work on macOS; I don't seem to have any other interesting modifications.
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
sweh
Posts: 2097
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Deploy-and-run from PC to Beeb?

Post by sweh » Wed Sep 18, 2019 12:50 am

myelin wrote:
Tue Sep 17, 2019 4:59 pm
Looking at my TubeHost code, I changed that line to:

system("stty -f $socket_path $BAUD crtscts ignbrk ignpar -icrnl -ixon -opost -isig -icanon -iexten -echo");

I think this made it work on macOS; I don't seem to have any other interesting modifications.
Did you use the tty or cu device?

("-f" isn't portable; on Linux it'd be "-F". But this could easily be handled. If you wanna raise a pull request...!)
Rgds
Stephen

Post Reply