This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Leo Verto's profile picture

[Rednet][GPS]LeoSat - Remotely controllable turtle satellite OS

Started by Leo Verto, 23 December 2012 - 10:37 AM
Leo Verto #1
Posted 23 December 2012 - 11:37 AM
LeoSat is a turtle operating system designed for remotely operated turtles floating at maximum height, serving as rednet nodes and GPS hosts simultaneously.
It includes a login system to prevent unauthorized users from using administrative commands.

List of commands to user over rednet:
  • help: Returns basic info and list of commands (create a file called "help" and write something into it for custom help)
  • ping: Returns PONG by default, returns location if GPS host is enabled
  • pingmap: Returns a serialized table containing id, msg and distance of computers that answered a ping
  • login <password>: Attempts to authenticate
  • logout: Removes the current computer from the list of authenticated IDs
  • up: Sends the turtle up into the sky, only works if there is enough fuel for traveling up and down, requires auth
  • down: Sends the turtle back to the ground, requires auth
  • reboot: Reboots the turtle, requires auth
The GPS host works similar to the built-in one, you can either provide coordinates manually or it will try to get them automatically from other hosts in range. You can also disable the feature manually.

I highly recommend changing the variable 'sPass' (at the top of the code) before starting leosat, otherwise anyone else who knows the default password will be able to hijack your turtle.

Examples:
leosat <x> <y> <z> uses these coordinates for the host
leosat false disables the GPS host and does not attempt to get the coordinates
leosat attempts to get the coordinates from other hosts in range, disables GPS host if unable to determine position

Download:
LeoSat:
pastebin get rjiYpE0r leosat

LeoSat without fuel check (for servers with infinite fuel enabled):
pastebin get YhkxJG4E leosat

Simple rednet console for testing to be executed on another computer:
pastebin get CFwBqJEv rednetconsole

Changelog
v1.4: Added "reboot" command, added automatic creation of startup file if none is found, made height variable
v1.3: Fixed logout crashing the program
v1.2: Made pingmap easier to read, you need a timeout higher than 2 on the client to receive the answer
v1.1: Fixed some minor bugs, apparently the maximum height a turtle can get to is 254 and not 255
v1.0: Initial release

ToDo
  • Add rednet forwarding
  • Create proper client
Feel free to give feedback and please report any bugs you encounter. ;)/>
Edited on 06 January 2013 - 11:37 AM
PixelToast #2
Posted 23 December 2012 - 11:46 AM
i made a similar program that integrated into my turtle swarm code
it could scramble gps and share the distances with every turtle in the network allowing you to track any id

you could also update the program in mid air
Leo Verto #3
Posted 23 December 2012 - 11:57 AM
you could also update the program in mid air
Do you mean allowing it to receive commands on it's way up or down?
I didn't allow that by purpose, it would mess up the GPS server and other turtles using it as reference point would get lost.
Budman17r #4
Posted 24 December 2012 - 04:22 AM
Hey Mind if I code along with you? I kinda want the experience.
Leo Verto #5
Posted 24 December 2012 - 05:28 AM
Hey Mind if I code along with you? I kinda want the experience.
Sorry, what do you mean?
Budman17r #6
Posted 24 December 2012 - 06:35 AM
Well I wanted to help with an item. I'll show you in a bit, its rudimentary but will help the GPS function better.
PixelToast #7
Posted 24 December 2012 - 06:56 AM
you could also update the program in mid air
Do you mean allowing it to receive commands on it's way up or down?
I didn't allow that by purpose, it would mess up the GPS server and other turtles using it as reference point would get lost.
it has rcon and ftp
Leo Verto #8
Posted 24 December 2012 - 08:04 AM
you could also update the program in mid air
Do you mean allowing it to receive commands on it's way up or down?
I didn't allow that by purpose, it would mess up the GPS server and other turtles using it as reference point would get lost.
it has rcon and ftp
Oh, remote file access?
Maybe I should create a similar system too.
Budman17r #9
Posted 24 December 2012 - 10:48 AM
Hey Leo, Like I said I'm new at lua programming so the code sucks

I modified (and giving it to you) the up command added a 4th targ west or east, this makes the 2 west/east go down 3 after reaching the top, gets rid of the ambiguous cords

http://pastebin.com/B6ub2vHL

Let me know if you like it.

It also writes the startup file based on the targs, (and the new north/east/west/south targ (Only added East/west, did not code for north/south.
Leo Verto #10
Posted 24 December 2012 - 01:27 PM
-snip-
Thanks a lot, I integrated this partly, I'll try to release an updated version soon but I'll remove the y parameter completely and update the OP.
Budman17r #11
Posted 24 December 2012 - 07:40 PM
I'm honored. its no problem, I like what you have thus far, pretty damn sweet.
Budman17r #12
Posted 25 December 2012 - 07:05 PM
typo in the 1.4 adds an extra " to the else for writing to file
Leo Verto #13
Posted 26 December 2012 - 10:44 AM
typo in the 1.4 adds an extra " to the else for writing to file
Ok, rewrote most of it, sorry for removing your code but you can now specify the height you want the turtle to get to.
Your idea of automatically writing a startup script is great though. ;)/>
Budman17r #14
Posted 28 December 2012 - 04:26 PM
typo in the 1.4 adds an extra " to the else for writing to file
Ok, rewrote most of it, sorry for removing your code but you can now specify the height you want the turtle to get to.
Your idea of automatically writing a startup script is great though. ;)/>

lol its no worries, I like the idea, been using them since I found it =)

You're welcome
Leo Verto #15
Posted 30 December 2012 - 01:38 PM
Ok, I updated the console, you can send messages to a certain computer only by starting it like this:
rednetconsole <id>
Using it without a parameter will broadcast messages.

Thanks to ChaddJackson12 for helping with the console and providing me a turtle and a computer to test it on Geevancraft. :)/>
Leo Verto #16
Posted 06 January 2013 - 12:40 PM
Added a version without fuel check.

I tested this program on Geevancraft and it seems to work great, except for that turtle that decided to shut down at y 254 (I had to tower up and down twice).
The startup file should be automatically created once you send the turtle up into the sky, it will launch leosat with the same parameters you entered before.
D3matt #17
Posted 08 January 2013 - 09:42 PM
Added a version without fuel check.

I tested this program on Geevancraft and it seems to work great, except for that turtle that decided to shut down at y 254 (I had to tower up and down twice).
The startup file should be automatically created once you send the turtle up into the sky, it will launch leosat with the same parameters you entered before.
Doesn't Geevancraft have a super-long rednet range?

Either way, nice program. A simple way to automate a simple process, with a few extra bells and whistles.
Leo Verto #18
Posted 09 January 2013 - 04:08 AM
I tested this program on Geevancraft and it seems to work great, except for that turtle that decided to shut down at y 254 (I had to tower up and down twice).
The startup file should be automatically created once you send the turtle up into the sky, it will launch leosat with the same parameters you entered before.
Doesn't Geevancraft have a super-long rednet range?
Either way, nice program. A simple way to automate a simple process, with a few extra bells and whistles.
It does have a very huge rednet range and I'm currently working on providing 24/7 global free rednet. Keeping your turtles close to max height also protects them from grievers.

I thought of adding a rednet forward/broadcast command, I might do that soon.
amtra5 #19
Posted 03 February 2013 - 04:26 PM
Is it not possible to change the co-ods that are transmitted if the turtle is moving, thus not confusing any turtles. This could be done by writing the current coordinates in a file and changed when moving
Leo Verto #20
Posted 22 May 2013 - 06:08 PM
I'm currently working on an update for LeoSat allowing you to move around the turtles freely, my next goals are encrypted communication and support for your own networking handlers, so you can use LeoSat as a wrapper for them.

Are there any people still interested in this program?
Scotty #21
Posted 22 May 2013 - 09:16 PM
I certainly am interested.

I've been having significant issues (on and off) with GPS. Some of the GPS clusters I've deployed have given inconsistent results, some have been fine.

It's all very odd, and tends to frustrate my goal to provide very widespread GPS.
sjkeegs #22
Posted 26 May 2013 - 01:35 AM
I'm currently working on an update for LeoSat allowing you to move around the turtles freely, my next goals are encrypted communication and support for your own networking handlers, so you can use LeoSat as a wrapper for them.

Are there any people still interested in this program?
I'm still interested - I haven't used this yet, but I've been keeping track of it for a project that's taking too long to start.
Leo Verto #23
Posted 26 May 2013 - 07:37 AM
Ok, I'm going to continue this project then, the next version should be ready soon, just needs to be debugged.
Conan1981m #24
Posted 07 June 2013 - 12:17 PM
Very cool !!
in my opinon it could check for GPS locate and
if theres a feedback and the player gave some coords manually,
it can check the integrity of the actual GPS and prompt something like "Check the given coords or remove existing GPS before using"
That would prevent bad GPS locations, just for the case …
im not that much in to coding but that would seem to be pretty simple to do by setting 59-69 to 49 … so to say and some tiny changesin between …
What do you think ?
logwet #25
Posted 14 July 2013 - 05:57 AM
Ahh how do you use this!