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

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

#21 Post by Ted Dog »

The way I done something similar was to create one webpage on the server that contained all the elements you wish to control as a large screen then just show that part on which ever screen asked. Like

//Control.html?screen=1

//Control.html?screen=2 etc.

that way only ONE webpage exists, and that can keep up with all the variables and displays in a single 'program'

I wrote a single page 'shopping cart' that only showed the subset needed.

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

#22 Post by starhawk »

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

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

some ideas

#23 Post by mister_electronico »

Some Ideas

check splash screen in:
http://murga-linux.com/puppy/viewtopic.php?t=38608

In this same page check to for:
How to store window size/placement


window borderless

http://www.murga-linux.com/puppy/viewto ... 490#701490


black background use one image for background black.


SVG images you can create anything or panel with hot keys look this link:


http://en.wikipedia.org/wiki/File:Oscilloscope.svg

http://www.svgopen.org/2005/papers/Maki ... SVGFormat/

http://commons.wikimedia.org/wiki/File: ... _panel.svg

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

#24 Post by starhawk »

Thanks, mister_e -- all of that is very helpful :)

Can I create a borderless window, say, the size of the screen, and not have it try to argue with me?

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

Other Ideas

#25 Post by mister_electronico »

Other Ideas.

See this code:

Code: Select all

#! /bin/bash

export DIALOG='
<window title="Window" height-request="1800" width-request="2440">
  <vbox>
    <frame>
      <text>
        <label>trying fit the window to the window desktop.</label>
      </text>
    </frame>
    <hbox>
      <button ok>
      </button>
    </hbox>
  </vbox>
</window>'

gtkdialog4 --program=DIALOG 
This window fill all my desktop.

You must fit the line:

Code: Select all

<window title="Window" height-request="1800" width-request="2440">
height-request or width-request at you window desktop.

Anyway If for example you create a window without borderless that contains an SVG image with black background using a pixmap to fill the entire window and you simultaneously create a background image desktop of the same black color, do not you'll have to worry about the size of the window not appreciate the difference between the background-desktop and window program.

All this is an idea that I have never tried this.

I nerver argue with anybody, I am here for enjoy Puppy, for help and if I can ever help someone. :wink:

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

other try

#26 Post by mister_electronico »

starhawk check this code.

Code: Select all

export IMG23=/tmp/img23.svg
trap 'rm -rf $IMG23' EXIT
echo '  <svg id="svg1"> 
  <rect
     width="980.74536133"
     height="980.74542236"
     x="0.0"
     y="0.0"
     style="font-size:12;fill:#000000;fill-opacity:1.00;fill-rule:evenodd;stroke-width:3pt;"
     id="rect563" /> 
     </svg>' > $IMG23


export DIALOG='
<window title="Example Window" decorated="false">
  <vbox>
  <eventbox>
    <pixmap>
      <variable>PICTURE</variable>
      <input file>'$IMG23'</input>
    </pixmap>
    <action signal="button-press-event">Exit:</action>
  </eventbox>    
  </vbox>
</window>
'
gtkdialog --program=DIALOG
Save in one text file for example test.sh

# chmod 777 test.sh

# ./test.sh

The problem is the contour line of the window but this can be solved by picking a black theme in Gtk + 2.0 Change theme.

See you

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

#27 Post by starhawk »

Works, although (in Carolina Vanguard, which uses XFCE) I get a border anyways.

I'm not in TahrPup right now, and I've a different WM going on because of that, so it's probably fine.

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

Question?

#28 Post by mister_electronico »

Works, although (in Carolina Vanguard, which uses XFCE) I get a border anyways.
When you say "I get border anyways" Are you referring to this :
Attachments
IMG23.png
(16.59 KiB) Downloaded 106 times

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

CONTINUE

#29 Post by mister_electronico »

If this is the problem the solution how I told you:


The problem is the contour line of the window but this can be solved by picking a black theme in Gtk + 2.0 Change theme.

I am using JWM.

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

#30 Post by starhawk »

You did say that, didn't you. :oops: Somehow I missed it.

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

lol

#31 Post by mister_electronico »

Do not worry often happens to me too. :lol:

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

Hi starhawk you try this.

#32 Post by mister_electronico »

Hi starhawk you try this.

I'm also interested in making control panels for my electronic equipment, so I started thinking about what you said.

Thanks to the code of the wonderful people on the forum "Gtkdialog tips" I could do this small example that can be a beginning to create more complex panels.

I have adapted the code for this small panel.

With the following results.
Attachments
PANEL.png
(10.03 KiB) Downloaded 302 times

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

Hi starhawk you try this.

#33 Post by mister_electronico »

I hope he can be transferred to other computers without problems since it may different settings do not work desktops.

You have to download the compressed file, decompress and get into the /PANEL directory and run by:

./panel.sh

You may need to give permission

chmod 777 panel.sh


And itch with the mouse in the panel buttons.

I hope it useful for you, and tell me if it works.

Greatings.
Attachments
panel.tar.gz
(1.44 KiB) Downloaded 235 times
Last edited by mister_electronico on Tue 05 May 2015, 11:55, edited 1 time in total.

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

no no no

#34 Post by mister_electronico »

mistake ... post.

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

Re: Hi starhawk you try this.

#35 Post by greengeek »

mister_electronico wrote:I hope it useful for you, and tell me if it works
Very clever. Works for me. Although I do notice that it requires a long press on the mouseclick button - if I do my normal click it does not respond so I have to hold my finger on the button a little bit longer than usual.

Post Reply