Calling all Socket experts

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.

@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?

@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

@dave1707 - thanks for the post, busy now test later.

@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.

@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.

@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.

@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.

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.

@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?

@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.

@Bri_G Fantastic, I hope it helps!