Done using CosmosEx

News, questions and bugs reports about CosmosEx by Jookie. Now we have a Raspberry Pi in our machines!

Moderators: Jookie, Moderator Team

User avatar
AdamK
Captain Atari
Captain Atari
Posts: 234
Joined: Wed Aug 21, 2013 8:44 am

Done using CosmosEx

Postby AdamK » Mon Dec 21, 2015 10:29 pm

This: viewtopic.php?f=18&t=29028 has been done using CosmosEx. The fact is, CosmosEx made it easy. Thanks Jookie :D

What I did: I figured out, how CosmosEx web interface works, so I was able to make my own http queries to simulate keypresses. Then it was easy: so me some scripting, and after about a month, I was done.

I'm will not publish scripts (they are crafted to my needs and a bit messy), but I'll share them with anyone that asks.
Atari: FireBee, Falcon030 + CT60e + SuperVidel + SvEthlana, TT, 520ST + 4MB ST RAM + 8MB TT RAM + CosmosEx + SC1435, 1040STFM + UltraSatan + SM124, 1040STE 4MB ST RAM + 8MB TT RAM + CosmosEx + NetUSBee + SM144 + SC1224, 65XE + U1MB + VBXE + SIDE2, Jaguar, Lynx II, 2 x Portfolio (HPC-006)

Adam Klobukowski [adamklobukowski@gmail.com]

User avatar
Cyprian
Atari God
Atari God
Posts: 1404
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Done using CosmosEx

Postby Cyprian » Mon Dec 21, 2015 11:12 pm

well done Adam.
I'm interested with this script. I'd like to automatize some of my tests.
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: Done using CosmosEx

Postby tin » Tue Dec 22, 2015 12:52 am

That's absolutely awesome! The Cosmosex HTTP Rest (well, more rest-ish) API was done with use cases like this in mind.

Admittedly not documented at all (other things *cough* STNICCC *cough* prevented that).

If there is interest, it can be documented - and expanded even.
For example: There is an HTTP Rest(ish) API for uploading disk images and selecting slots. So every script/program on any device that speaks HTTP can control that part of the CE. Your mobile, Tablet, even your other Ataris.

A shame we didn't bump into each other at STNICCC :)

User avatar
Kirkman
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 121
Joined: Fri Sep 03, 2010 2:29 am

Re: Done using CosmosEx

Postby Kirkman » Tue Dec 22, 2015 2:00 am

Wow. I used the webcasting feature to record some stuff a while back, but I'd love to see the REST API documented.

User avatar
Cyprian
Atari God
Atari God
Posts: 1404
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Done using CosmosEx

Postby Cyprian » Tue Dec 22, 2015 9:40 am

tin wrote:If there is interest, it can be documented - and expanded even.

I confirm, there is an interest and a demand :)
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: Done using CosmosEx

Postby tin » Tue Dec 22, 2015 5:18 pm

Cyprian wrote:I confirm, there is an interest and a demand :)


Just a quick copy+paste from source, probably known, but I might have minified the JS, I don't remember.

Code: Select all

/*================================================================
  CosmosEx floppy manager
  ================================================================
  Just a quick usage example for the CosmosEx HTTP Floppy API
  ----------------------------------------------------------------
  RESTlike interface, using json

  /api/v1/floppy/[slot# 0-2]    POST
  Upload file
 
  /api/v1/floppy/[slot# 0-2]    PUT
  Activate slot - all others are deactivated

  api/v1/floppy/    GET
   {"slots":["filename_slot1.msa","filename_slot2.msa","filename_slot3.msa"],"active":null|0|1|2,"encoding_ready":true|false}

  ----------------------------------------------------------------*/
/*================================================================
  CosmosEx simple remote control
  ================================================================
  Just a quick usage example for the CosmosEx HTTP Mouse/Keybard API
  sends keyboard events as linux keycodes to the HTTP API as well
  as relative mouse packets
  ----------------------------------------------------------------
  RESTlike interface, using json

  /api/v1/mouse    POST
   Mousemove:
   { "type":"relative", "x": 8, "y": 21 }
   Mouse click:
   { "type": "buttonleft", "state": "down" }
   { "type": "buttonright", "state": "up" }

  /api/v1/keyboard    POST
   { "type": "pc", "code": 40, "state": "down" };
   { "type": "pc", "code": 40, "state": "up" };
   
   (keycodes are linux keycodes, can be converted from browser keycodes via array in keylinux.js)

  ----------------------------------------------------------------*/
/*================================================================
  CosmosEx config terminal emulator
  ================================================================
  ----------------------------------------------------------------
  RESTlike interface, using json

  /api/v1/config/terminal    POST
  Send Key
 
  /api/v1/config/terminal    GET
  Get current screen as VT100 sequence

  ----------------------------------------------------------------*/


This is all kept pretty straightforward for ease of use. This Info should be still valid, but don't get disappointed if there are small deviations.

And there is /app/screencast/getscreen GET, returning a copy of 32000 bytes that the screen pointer points add. There is probably palette info in there too, I have to have a closer look.

Could someone with Atari-Forum Wiki knowledge park this on the Cosmosex page for now? The documentation will be added to the CE webserver itself, but that won't happen until january, I'm afraid.


Social Media

     

Return to “CosmosEx”

Who is online

Users browsing this forum: No registered users and 2 guests