Interfaces that talk across multiple computers, how?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

Interfaces that talk across multiple computers, how?

#1 Post by starhawk »

This is a 'how the crap do I even do this' sort of question.

I'm building a silly thing. (At least I admit it.)

Inspired by this and this and this and a few of these, I've been working in fits and starts (mostly short fits and false starts) on designing my own, er, simulated starship control console.

(I assure you I've not yet been diagnosed as mental... yet... we all certainly have our moments, though, I suppose!)

I've finally settled more-or-less on how I want to do it, after a year or so of working and reworking everything over and over and over again. (Seriously, there's been so many 'revisions', for lack of a better term, that I can't even count them.)

I will be using six HP t5630W thin clients rigged as desktops. (Not that hard.) Five of the six systems output to a set of 7" LCD monitors from eBay, that display at 480*234 pixel resolution using VGA. One screen per computer. The sixth system outputs to a 15" HP Pavilion vf52 LCD monitor at 1024*768 resolution. All six systems will run (probably) TahrPup 6.0.2. (I am anticipating the arguments I'll be having with xorgwizard over those 7" displays -- and I'll have you know that I'm not looking forward to it one bit!)

Each system will be connected by Ethernet cable to an eight-port network switch. (Not a router! ...er, eight ports because six-port switches are oddly more expensive and less common.) Input to the systems will be from modified PS/2 keyboards (I'll be replacing the internal switch membranes with my own switchgear, and leaving out some keys). There will be no mouse input.

I need to have each system run a display and respond both to input from the keyboards and from other systems, as well as generate output to those other systems. The displays will basically mimic old indicator-light type displays, sort of... I'll get mock-up images up once I've finished making them. (As of now, I've only got one.)

The language (for lack of better terminology) is what's throwing me at the moment. I've thought of Flash and HTML5 running in Chromium in Kiosk Mode (full screen without notifications) -- but I don't know how to do the conversational part with those. I've thought of GTKDialog inside of a bash script, combined with some sort of tty-over-a-network thing (socat, maybe?) -- but with that I just don't know how to make it look right. I can tell you right now that I cannot do C family anything (I'm a BASIC kinda guy and that won't work here) but I don't know what *will* work.

I don't mind abandoning the idea of using Ethernet -- I'd be quite happy with serial over COMports if I could find some way of making the systems converse with that. (Heck, for that matter, good old TTL serial would be fine with me!)

So, er, what should I program this in, so that it'll work?

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#2 Post by starhawk »

Oh, sorry, specs on those thin clients are below. I meant to put them in the first post and it didn't happen.

VIA Eden (Esther core) 1GHz CPU
VIA VX800 Chipset
2gb Flash Storage (IDE Disk-On-Module, sort of a mini SSD thing)
1gb RAM (stock, may upgrade to 2gb, haven't decided)
Integrated VIA Chrome9 video

OS will, again, probably be TahrPup 6.0.2, but I'm wide open as far as that goes. While I strongly dislike (at best) JWM/ROX, they are adequate for this.

More info on the hardware, here --> http://www.parkytowers.me.uk/thin/hp/t5540/index.shtml

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#3 Post by starhawk »

Last post here for tonight. (And sorry for three in a row that are all me!) I've attached three screen/panel mock-ups to this post. I'm not done yet, but these will give a fair idea of the appearance I'm looking for. All are 480*234 to fit the screens. Darker colored 'buttons' (indicators, really) get brighter (or not) as necessary to indicate status/faults/etc. There are controls, which I did not draw in any image -- but the relevant part of the control interface is described in the first post.

TBH, if I could do this in bash/GTKDialog and have it come out looking right I'd be a happy man indeed... but I'm pretty sure I can't :( I know what GTKDialog usually looks like -- and this ain't it.
Attachments
SysMon Panel Mock-Up.png
system monitor screen mock-up
(66.51 KiB) Downloaded 473 times
PwrMgmt Panel Mock-Up.png
power management screen mock-up
(66.92 KiB) Downloaded 434 times
Helm Panel Mock-Up.png
helm screen mock-up
(64.14 KiB) Downloaded 434 times

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#4 Post by Ted Dog »

I'd go with one being a web service to the others. Compile an image mapped graphic ( tools on web ) and assign functions to swap graphics like amazon does with its rating stars. What you show there would be very easy as an interactive webpage. Otherwise if you are going mixed hardware real buttons etc.. The cheapest would be the way that dad did it. A half dozen 4 dollar audruo chips and a RaspberryPi2B to run it all.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#5 Post by greengeek »

The only thing I can suggest is html. Although i have no idea how one would get a fullpage effect so that the menu bar and window title etc were hidden. BarryK was playing with html element placement and SFR suggested a method in these posts here

EDIT : how does each element change? As a result of you activating what used to be a keyboard key?

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#6 Post by starhawk »

@greengeek -- HTML's what I was thinking, but I've no idea how to do the inter-system communication bit. For example, if the 'overall power system load' indicator maxes out on the Power Management screen for ~30sec, the (simulated) power system cuts off automatically, and everything goes to emergency power there.

That's all well and good, but it affects other screens as well -- on the System Monitor screen, the 'pwr flt' (power fault) indicators will light up, depending on what supposedly popped first, and the 'pwr ss' 'tct ss' and 'aux ss' lights will come on under 'gen flt' (general fault) -- power is offline and tactical and auxiliary systems do not receive emergency power. Further, on the Helm screen, regardless of what speed one was travelling before, the 'ship' will drop to 'stat keep' (station keeping -- just enough engine to keep in place without drifting, sort of a running-to-stand-still sort of thing). If one was travelling at (per indicators shown) 'hypl 100' (hyper-light range, 100c speed), then the 'hypl 100' would be lit as 'stat keep' blinks for ~5sec, and then 'hypl 100' would go out as 'stat keep' went to on but not blinking.

Trouble is, I've now described three separate screens driven by three separate computers, all of whom have to know what's going on with the others.

User input, as mentioned, is by modified keyboards. So, for example, if one wants to go to 'stat keep' from 'hypl 100' -- first you press a key on the right side of the screen, next to 'stkp' under 'menu'. The relevant 'stkp' element lights up, and the 'stat keep' speed indicator starts blinking. Pressing the relevant button below the screen makes 'stat keep' go steady-on, and puts out 'hypl 100'. If one doesn't press the speed button within ~30sec, then 'stkp' stays lit, but 'stat keep' goes out, and the 'st kp' indicator in the 'i/l flt' (interlock fault) stack starts blinking. The user then has ~10sec to press the proper button before the system drops them to station keeping anyways (which is the default action for button mishaps such as that).

*ahem*

I haven't actually mapped out what keys do what -- yet. I *have* found out how to do fullscreen, no notifications, in Chrome/ium, though, so I've got that covered. If I can do HTML and still have each computer talk to the others, then I'm all set.

Oh -- I left this out of the first post (dangit!) but all six computers run a static IP. They aren't actually connected to the 'Net, just to each other -- hence the choice of a switch rather than a router -- switches create networks, routers connect separate networks together, and hubs (for the record) spew packets everywhere.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#7 Post by greengeek »

starhawk wrote:Trouble is, I've now described three separate screens driven by three separate computers, all of whom have to know what's going on with the others.
I can only assume that one of these computers (or another separate one...) will have to be a 'server' that maintains a database of each and every display element name used across all the other screens, and including current state of each of these elements - and then every other PC will have to check "current_element_state" in that database for each of the elements it is supposed to display on its own screen (or factor in to it's own calculations).

If not a database, then at least just a text file that can be speedily updated in realtime.

So this setup might allocate one PC as "The Brain" which handles the display_element_database, and also builds up a list of current_switch_states which are sent to it from each other PC. This server PC does all the thinking, and all that the 'slave' PCs do is feed their switch states to the main PC, and read back from that PC what display elements they are supposed to display.

Just spitballin' here...

PS: I particularly like the element shown in your third pic - "FARTDRIVE SYSTEM LOAD".
Definitely a critical function of the highest priority.
:)

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#8 Post by Keef »

... and what about the "Captain's Log"?

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#9 Post by greengeek »

... presumably he'll just flush it :D

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#10 Post by starhawk »

@greengeek, Keef -- Very funny (not)... might I recommend glasses, since there's no 't' in fardrive (as in, far drive not near drive)...?

*ahem*

Wasn't planning on a dedicated control server, but I guess I could adapt to that, maybe. What I was thinking was more along the lines of a shared controller/terminal model where all six computers would sort of be both at once, exchanging messages in between as needed. I would've been fine with RS-232 and a COMport hub, but COMport hubs are insanely expensive.

(Hmm. Wonder if I could set up a hub for TTL...? If so, I could use that...)

That said, I've no idea how to work it with a server in the middle.

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#11 Post by starhawk »

starhawk wrote:Wasn't planning on a dedicated control server, but I guess I could adapt to that, maybe. What I was thinking was more along the lines of a shared controller/terminal model where all six computers would sort of be both at once, exchanging messages in between as needed. I would've been fine with RS-232 and a COMport hub, but COMport hubs are insanely expensive.

(Hmm. Wonder if I could set up a hub for TTL...? If so, I could use that...)

That said, I've no idea how to work it with a server in the middle.

User avatar
Packetteer
Posts: 73
Joined: Sat 12 May 2012, 19:33
Location: Long Island Ny

#12 Post by Packetteer »

Hi starhawk
Slacko and Percise puppy come with Hiawatha web server built in.
Possibly all versions of Puppy have Hiawatha built in. If not you can install
Hiawatha for your version of puppy.

Using Hiawatha as a web server on the seventh PC you can use CGI to
run your whole setup.
Each display PC would connect to the Hiawatha web server. The PCs would each
connect to a different web page on the Hiawatha web server. Each web page
would display the "Screen" that you want to display on each PC.

You mentioned in an earlier post that you are a "BASIC" guy. If that means that
you are a Basic computer language programer then you can use Basic to
program the CGI stuff. (Stuff is a technical term)

I have a Bacon CGI demo program you can if you like go to the following
URL and read my posts on the Bacon forum on how to use CGI, Hiawatha and
Bacon.

http://basic-converter.proboards.com/th ... st-command

The above URL is the whole Bacon forum discussion you want to go to
my Dec 21, 2013 at 12:04pm post to get to the final example.
Note there is a URL in that post for this forum that demonstrates how to setup
Hiawatha in Puppy Linux.

Note you of course do not have to use Bacon to program your space ship.
You can use any Basic language or any PC programing language of your
choice.

The CGI commands that your six PCs send to the Hiawatha web server
PC would run different programs on the server PC that would Serve up
different web pages for each PC. Also the web server PC would keep track
of the changes made by the six other PCs and therefore know what the
web pages to server up.

Hope the last paragraph makes sense.

Hope this post is of some help.

Thank you for your time in reading this post.

Best Regards
John

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#13 Post by starhawk »

I'm used to MS QuickBASIC PDS 7.1 :oops: it's old and it's Micro$oft -- and I've literally *never* done graphics with it.

I could actually do it in bash/GTKdialog and I'd be okay with that -- if I could get my head around how to make the dang thing look right. That's really how I *want* to do it... I just haven't figured out the appearance. Once I get that... the rest will come.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#14 Post by greengeek »

Packetteer wrote:Each display PC would connect to the Hiawatha web server.
How is that connection best made? Would the display PCs simply use the IP address of the webserver or would this require a router that handled DNS?
starhawk wrote:I need to have each system run a display and respond both to input from the keyboards and from other systems, as well as generate output to those other systems.
If you want to avoid a central server, I wonder if it would be possible for every one of the PCs to be running both as a server (to send data to other PCs) and as a client (to receive data from other PCs) all via the cgi suggested above?

A matrix of webservering.

User avatar
Packetteer
Posts: 73
Joined: Sat 12 May 2012, 19:33
Location: Long Island Ny

#15 Post by Packetteer »

greengeek wrote
How is that connection best made? Would the display PCs simply use the IP address of the webserver or would this require a router that handled DNS?
I have never used a switch. My use of Hiawatha used two wireless routers.

Since a switch is being used I "guess" then you would use the IP address.
Of course the IP address has to be static.

This is all a guess on my part.

Best Regards
John

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#16 Post by greengeek »

Just a crazy thought that pops into my head - I wonder if there is some way that one PC could send an "xdotool" command to another? eg: PC1 detects you clicking the "F" key on one keyboard ("Fire !") and as a result it sends an "xdotool key F" command to PC2 which controls the Firing Control Subsystem.

How could it send such a command? Via SSH? Or via some other network software? Or will there be a need for some degree of hardware interlinking here - will one PC have to have a direct connection into another PC? (eg PC1 drives a solenoid or relay which activates a key on a keyboard that is connected to a usb port on another PC?). This would potentially be an untidy spider web of tangled cables but it's definitely possible to tap into usb keyboard devices for special purposes. I tried it here

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#17 Post by starhawk »

Screw Ethernet, I've got something better now.

Friend of mine told me how to do the RS-232 (COMport) bit. Programming it up will be a bit of a PITA but I'm going to do that anyways, so whatever.

It's very simple, hardware-wise. Take the systems' COM Ports. Tie the TXD pin of each port to the RXD pin of the port on the next computer in line. Tie the GND pins together (common electrical ground is very important here, since it's the reference that the everything else relies on).

Software-wise -- each computer gets a name. Each 'packet' of data (for lack of a better term) contains a 'header' with the name of the intended recipient system. Each computer, when it gets a packet, examines the header. If it matches, then the computer reads the rest of the packet and acts on it. If the header does not match, then the system passes the packet along to the next computer. It's a bucket-brigade sort of scheme.

Since all along I've been planning on sending very simple text data, this will actually work pretty well. At 115200 baud (that's a bit over a hundred and fifteen thousand characters per second) the otherwise-significant latency induced by the bucket-brigade method shouldn't even be noticeable to the user. Mind you, if I was going at 300 baud like an old modem... that would be different. I think I can do a little better than that ;)

Keep in mind that this method is far, far less harebrained than what I'd originally come up with... I'm not even going to put that one up, it's actually kind of embarrassing how bad it was.

So. Next question.

Assuming that I will be using bash and GTKDialog, how do I get a full screen black background and borderless dynamic (changeable) images onto a monitor...? How do I specify the position of the images? (I assume it's XY coordinates starting from a 0,0 point? Where's 0,0?)

User avatar
Packetteer
Posts: 73
Joined: Sat 12 May 2012, 19:33
Location: Long Island Ny

#18 Post by Packetteer »

starhawk wrote
Assuming that I will be using bash and GTKDialog, how do I get a full screen black background and borderless dynamic (changeable) images onto a monitor...? How do I specify the position of the images? (I assume it's XY coordinates starting from a 0,0 point? Where's 0,0?)
Unless Linux is totally different then Windows (which it probably is)
traditionally 0,0 is the upper left corner of the screen.

Best Regards
John

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

RS232 serial port communication

#19 Post by mister_electronico »

I do not know exactly what you want to do, but I communicate with design electronic equipment through the serial port:

As you see in the following link.

https://misterelectronicoes.wordpress.c ... -homemade/

Currently I'm working hard to create and control panels for the presentation of these programs.

http://murga-linux.com/puppy/viewtopic.php?t=97961

and the rotary knob

http://murga-linux.com/puppy/viewtopic. ... 367#840367

This is it probably too simple pair the project you want to do, but like everything in this life can be improved.

Greatings

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#20 Post by starhawk »

@mister_electronico -- Those are pretty cool, but indeed not applicable to what I'm doing. Read my first three posts, and you'll see quite plainly what I'm up to.

@Packetteer -- I seem to recall that in JWM, 0,0 is the center of the screen -- it's my memory, could be way off -- but that's why I asked.

Post Reply