Jump to content
IGNORED

rjcp: Remote jcp script


Recommended Posts

Just wanted to share a little tool I use to run jcp on a remote machine.  I have my skunk connected to a little rasberry pi-like device sitting next to my jag so I don't need to run a USB cable across my floor to interface with it.  However, the machine is pretty slow and the tiny USB WiFi adapter I access it with is even slower, so it's still more convenient to run the actual development tools locally.  This led me to write up this little shell script that lets me run most of the jcp commands against local files but using a remote instance of jcp.  To use it, just download it and make it executable.  It should work on Macs and Linux.  jcp needs to be suid root and in the path on the target machine.  Example session I just went through while testing my modifications to the Cinepak sample player:

$ rjcp 192.168.1.50 -s

jcp v02.04.01 built on Jun  3 2020

Boot version 03.00.02, Serial XXXX

$ rjcp 192.168.1.50 -n ../movies/sync 0x3ffc0

Remote filename: /tmp/rjcp.GExAL7wP
sync                                                 100%   64    17.0KB/s   00:00    
jcp v02.04.01 built on Jun  3 2020

Skip 0 bytes, base addr is $3FFC0, length is 64 bytes
Sending...
Finished in 2040 millis, 0KB/second.

$ rjcp 192.168.1.50 -n sinejul.crg 0x40000
Remote filename: /tmp/rjcp.tFBmy69z.crg
sinejul.crg                                          100% 1065KB 134.0KB/s   00:07    
jcp v02.04.01 built on Jun  3 2020

Skip 0 bytes, base addr is $40000, length is 1090624 bytes
Sending....................................
Finished in 2928 millis, 372KB/second.

$ rjcp 192.168.1.50 ../sample/player.cof
Remote filename: /tmp/rjcp.F3WOOk7I.cof
player.cof                                           100%   19KB 120.6KB/s   00:00    
jcp v02.04.01 built on Jun  3 2020

COFF File:  Skip 168 bytes, base addr is $4000, length is 18844 bytes
Sending...
Jag accepted start request at $00004000.
 
Finished in 58 millis, 324KB/second.

Or in other words:

$ rjcp <remote host> <jcp commands>

Works best when you have ssh keys set up on the remote host.  Otherwise you'll need to enter your password up to 3 times per command.  Any suggestions for improvements welcome!

rjcp

  • Like 2
Link to comment
Share on other sites

Thank you for sharing.

 

Some time ago, I did a jcp2 version based on the original jcp to include features such as:

* ELF binary format support
* USB port, Bus and Port, and Skunkboard serial number selections
* Libusb 1.0.x support

https://github.com/djipi/Skunkboard

 

In theory, with your script, it would be possible to have a remote farm of consoles with Skunkboard.

  • Like 2
Link to comment
Share on other sites

Oh, cool.  I'll have to check that out and update the script to support the new options.  I've been meaning to look into the removers version's extra debugging stuff as well, but haven't had a need yet.

 

If I ever get my around to attempting to assemble my own skunkboards (found sources in theory for all the parts, but they are getting scarcer and scarcer) multi-card support might be handy, but I don't plan on purchasing anymore for actual practical purposes. The thought of something like a server farm of Jaguars+skunks churning away on some crypto mining at a glacial pace is amusing to think about though ?

  • Haha 2
Link to comment
Share on other sites

36 minutes ago, cubanismo said:

Oh, cool.  I'll have to check that out and update the script to support the new options. I've been meaning to look into the removers version's extra debugging stuff as well, but haven't had a need yet.

I've not tested it in Linux environment, but let me know if you meet issues.

Do you have a link to the removers version's extra debugging stuff? Or are you referring to the jserve tool?

36 minutes ago, cubanismo said:

The thought of something like a server farm of Jaguars+skunks churning away on some crypto mining at a glacial pace is amusing to think about though ?

Meanwhile, at Skynet headquarters...

Link to comment
Share on other sites

4 hours ago, dilinger said:

Do you have a link to the removers version's extra debugging stuff? Or are you referring to the jserve tool?

Not exactly.  It may just be support code for the rmvlib printf functions. I'm not familiar with it at all.  @SebRmv (Hope this is the right Seb) would probably know more.  I came across it while wandering through @belboz's dev environment files for Linux, and after googling a little this was all I found:

I'd like a pointer to the source myself since I'm slowly building up a git submodule tree that generates something similar to the Belboz SDK from source so I can build native binaries for x86_64 and ARM Linux environments for the majority of the tools.  However, I haven't gotten to the point where I'm using anything that requires it yet, so it's just a bullet way down my list of TODO's for that project.

Link to comment
Share on other sites

2 hours ago, cubanismo said:

Not exactly.  It may just be support code for the rmvlib printf functions. I'm not familiar with it at all.  @SebRmv (Hope this is the right Seb) would probably know more.  I came across it while wandering through @belboz's dev environment files for Linux, and after googling a little this was all I found:

I'd like a pointer to the source myself since I'm slowly building up a git submodule tree that generates something similar to the Belboz SDK from source so I can build native binaries for x86_64 and ARM Linux environments for the majority of the tools.  However, I haven't gotten to the point where I'm using anything that requires it yet, so it's just a bullet way down my list of TODO's for that project.

Oh, I think I never saw that (or at least do not remember).

Yes, I should publish source of rmvjcp, let me do some cleanup in my files, before.

Link to comment
Share on other sites

  • 3 months later...
On 6/12/2020 at 11:23 AM, dilinger said:

Some time ago, I did a jcp2 version based on the original jcp to include features such as:

I finally looked at this briefly the other day, but I also recently learned (while looking at Seb's github above) that @Tursi put his latest sources up on github as well (https://github.com/tursilion/skunk_jcp).  @dilinger, would you have any interest in merging your code with Tursi's? Tursi has merged the removers support code back into his already (build-time option), and it would be nice to not have to deal with multiple jcp forks to get the full featureset.  A more minor issue, but I noted you license your changes under GPL-3 currently, and I personally prefer more permissive licenses (The rest of the skunk code is public domain, as is the Atari SDK/sample code at this point from my understanding), but that is of course up to you as the author.

 

Regardless, I will try to add support for the new command line switches to rjcp when I get a minute or two.

Link to comment
Share on other sites

2 hours ago, cubanismo said:

@dilinger, would you have any interest in merging your code with Tursi's?

I understand your concerns; I have respects for the work done by Tursi and others people.

Tursi can have a look at jcp2 (https://github.com/djipi/Skunkboard) and takes whatever he wants. Or I can do a PR to his repository.

I would prefer to finish my JiFFI2 before to do the PR.

2 hours ago, cubanismo said:

A more minor issue, but I noted you license your changes under GPL-3 currently, and I personally prefer more permissive licenses (The rest of the skunk code is public domain, as is the Atari SDK/sample code at this point from my understanding), but that is of course up to you as the author.

The Github license definition was not set originally, so I added one; I will be glad to change it for one more appropriate.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Existing jcp should work fine on a Rasberry pi. I'm currently using a libre computer aml-s805x-ac board (Pi-like computer) on the remote end of this script.  Just pull down the sources and run make.  If you want to use the script as-is you'll have to make it suid root or mess with your USB permissions too.

 

One thing to watch out for is whether these tiny boards have enough USB power.  I had to run the cable through a USB hub to get it to work with the skunkboard when I also had a USB WiFi dongle plugged in.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...