Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Calling all Socket experts

edited December 2021 in Suggestions Posts: 2,574

Hi All,

As a result of recent interest I dug out my latest version of LoveCodea and am using it to add new features on my Elite Galaxies project. Also I dug out LoveBird for Love2D to do this so I could run it on my Mac with the editor and project window to modify live. I tried to add Lovebird to Codea (on my iPad) without sucess - by that I mean added it in a tab and followed the recommended use from the Lovebird website - it didn't crash Codea but I couldn't get a browser on my Mac to show the control panel.

Being relativley naive, when it comes to Sockets, I think a tool like this could be possible in Codea such that we can get a control panel on a Mac, PC, Linux or maybe even another tablet.

Anybody willing to have a look at this?

Pic of what I get with Love2d/Lovebird and LoveCodea on my Mac attached. Link for Lovebird here.

Edit: something like this must be possible as the browser editor from @John must work on a similar basis.

Comments

  • dave1707dave1707 Mod
    Posts: 9,808

    @Bri_G I don’t know if this would apply or not. You can send variable values or other info to another device. See this link.

    https://codea.io/talk/discussion/12729/remote-display#latest
    
  • Posts: 2,574
    @dave1707 - thanks for the post, busy now test later.
  • Posts: 2,574

    @dave1707 - loaded your code up and tried to link it to my Mac but couldn't get any response. I was trying to use a browser - is this code meant to run with identical code impplemented on both systems? ie without the use of a browser?

  • dave1707dave1707 Mod
    Posts: 9,808

    @Bri_G It was written to be used on 2 iPads, so the code needs to be running on both devices. I wasn’t sure exactly what you were trying to do, but it used sockets to communicate so I thought you might get something out of it.

  • Posts: 2,574

    @dave1707 - Oh I like the look of your socket code. Question there - do I need to enter both systems IP addresses or are they placed on each machine separately (last makes nore sense)?

    Is this designed to link to any other app, on another machine, which calls for a connection - like a browser?

    I could try to write this so that say a Love2D project contacts a Codea project using your code and LoveCodea and then see if I could use the Love2D system to interogate the Codea system and display updates and specified variables/etc.

  • dave1707dave1707 Mod
    Posts: 9,808

    @Bri_G With the code running on both devices, each ipad should get the IP address of the other device. Go to the link where I originally posted it to get more info and instructions. This probably only works with iPads and iPhones.

  • Posts: 327
    @Bri_G Check out the Web Server project on WebRepo. It's doing pretty much what you describe. I even have the equivalent (more or less) to Air Code working locally. I'll upload the WIP project here for you to take a look at.

    I've had this working with Codea in one screen split and safari in the other.
  • Posts: 327

    You’ll need to add ‘Web Server’ as a dependency but this should be similar to Air Code. Tbh, a fair amount of the html code was modified from Air Code’s so looks pretty much the same.

  • Posts: 2,574

    @Steppers - thanks for the posts, played around with your web server a bit and crashed a couple of times. Finally got it running with your last posts and the docs. Great code

    @Simeon - meant to ask before - I often crash my system and don’t know what the cause is. If I can reproduce I add text to the crash report and post off to you. Sometimes, I accidentally lose the crash report as I’m trying to check out the details by skipping to Codea. I have had a few crashes whilst playing around with this Server coding. So, my question is - do you still receive the crash error details with or without users reports? If so, sorry for all the blank reports.

    Finally, if Aircode interaction is built into Codea - any chance of building it in with a command structure with docs?

  • Posts: 2,574

    @Steppers - just tried a connection on my Android phone successfully. Very quick and text messaging OK. Thanks again - now to business to build this into a tool.

  • Posts: 327

    @Bri_G Fantastic, I hope it helps!

Sign In or Register to comment.