-
Posts
229 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Devon Custard
-
I work in IT so I take all this for granted, but it's good to be reminded that others don't necessarily know this stuff. I had to write a set of architectural policies about this very subject for my engineering team as part of our migration to Amazon Web Services. I go to sleep counting CIDR blocks instead of sheep :) Admittedly when I started this thread I was being lazy, I asked how to do it instead of just reading a LUA documentation site. 5 mins with Google and I had it cracked *winks @ Boltz*
-
Hmmmm rereading that it looks a bit ungracious, apols if i gave that impression. I really do appreciate the comments Tacno.
-
Much appreciated, gonna try your ideas out today. mine are just roughly thrown together hacks :)
-
Thanks Tacno, that just confirms my earlier discovery. Yup setting the socket might cause an error if that port was already in use, but im fairly used to setting ports up. So much easier to know what port is in use rather than having to code routines to detect a dynamic one. Certainly its a better approach for those who are running firewalls etc on their home machines (and these days you'd be mad not to). To be honest the most important outcome of this thread was to understand how the networking in LUA works. The available documentation from DCS is out of date and sadly lacking in explanation as Boltz already pointed out. The more people who share their experience here the better.
-
And done..... Easy once you know which values to use... Like to know who figured out to add 3000 to the button ids. Would have had no idea about that.... Time for bed i think :)
-
Right got it working. I actually want a seperate udp port so i added these lines to LuaExportStart udp=socket.udp() udp:settimeout(0) udp:setsockname('*',65001) This sets up a server rather than a client which is precisely what i want. Then i just do udp:receive.... I know im getting data into lua now, im dumping it into a file. Just need to do the performClickableAction and theres a fair amount of export.luas to crib from :)
-
The whole cockpit building thing is about proving i can do things :D
-
Helios does send data back, thats one of its many selling points. Do take your point about TCP, but i damn well want to solve this!!! I can resolve the ephemeral port easily enough, just want to prove i can send data back :)
-
As i thought, The UDP connection is on this port (highlighted in yellow) so returning any input needs to come in on this port. Simples. I feel an entry on the wiki coming up
-
Ok assuming this is true, it confirms my suspicions From http://w3.impa.br/~diego/software/luasocket/old/luasocket-2.0-alpha/udp.html Note: UDP sockets are not bound to any address until the setsockname or the sendto method is called for the first time (in which case it is bound to an ephemeral port and the wild-card address). For those who dont know what an ephemeral port is.... When you make a connection to a service over IP you connect to the destination services IP and port. Thats the same for TCP and UDP. However what you dont see is that your local IP network stack allocates a second port which is open on your local pc which the remote service returns its response to... So you might open a webbrowser to http://www.google.com. Default http transport is port 80 over TCP. Your local webbrowser is waiting for a response on a randomly assigned port in this case say port 32456.... You send to port 80, google.com sends to port 32456. DCS's lua engine is transmitting to whatever port you define in the export.lua but its ephemeral port can only be determined by examining the packet received by your UDP bridge. Ill be writing a quick hack to prove that tonight, hopefully results later. Heres a page on ephemeral ports.... http://en.wikipedia.org/wiki/Ephemeral_port
-
Just found this post.. http://forums.eagle.ru/showthread.php?t=45071&highlight=performclickableaction&page=12 Hey guys, just read through all the info in this particular thread. Please send me to another if it's been explained elsewhere. I'm using a pokeys to capture key presses, switches etc. I've got that figured out and running in a C# program. My question is this: I don't understand how I can use a UDP socket to get info back to the export.lua script. I understand that i create a listener socket on whatever port I choose and have my export.lua send stuff to it, but I don't get how my C# program can send stuff back? Forgive me if my socket-fu is not so strong, but I'm pretty sure that UDP is connectionless, and that I can't have a listener for the same socket in two different places on my PC. The example script I have (I think it might have been y2kiah?) has both incoming data (switches from my C# program) and outgoing data (updates from DCS) going on the same UDP socket. How does that work? Thanks for any wisdom! So i know this has been asked before. Just cant find anyone whos answered it!!!
-
Struggling with understanding how LUA receives data via export.lua. I can see the receive method thats being used, but its being called on the outbound socket? So TCP i could understand, as its a connection, you just respond on the established connection. But for UDP that just doesnt work, unless youre communicating between distinct IP addresses. You cant communicate between two processes on the sames IP+Port endpoint as one would block the other. Boltz is using TCP, but Gadroc uses UDP....arrgghh, the lack of documentation here is driving me nuts. Im toying with just instantiating a second connection object and receiving on that but id dearly love to know how Gadrocs doing it and others who have solved it. And yeah there'll be another tutorial once i understand it so anyone else can follow it.
-
DC Guides presents "Exporting data to an Arduino 101"
Devon Custard replied to Devon Custard's topic in Home Cockpits
Ask Pete, i dont know I2C, i do know however that you can drive it from Arduino. I doubt you should have any problems with I2C however, its just a driver chip. With most things its just a case a case of research (google) and trial and error. I picked up my first arduino in January, im not an expert by any stretch of the imagination but i can design a shift register circuit to drive LEDs now. Dont be put off by what you dont know, just start learning.... -
Question for panel makers - engraving.. how do you do it?
Devon Custard replied to Devon Custard's topic in Home Cockpits
Heartily agree with metalnwood. I spend £3k on mine and i love it but it still feels like a hobbyists laser :) And you will spend a good month or two playing with it before you get results youre happy with (assuming you work for a living, have a wife/gf etc all of which will get in the way) However you will love it when it starts chucking out nice clean cuts and your panels look (more) professional than a "cut by dremmel" look. Also make sure you have a workshop away from kids/family etc. The outgassing on these things is rough on the lungs, i literally made myself sick in the first week breathing in the fumes. Good ventilation/extraction is a must. -
Question for panel makers - engraving.. how do you do it?
Devon Custard replied to Devon Custard's topic in Home Cockpits
youre playing with a better toy than most lols gauging that correct scan gap to ensure a clean cut vs minimal overlap and therefore burning thru too many layers? ouch -
DC Guides presents "Exporting data to an Arduino 101"
Devon Custard replied to Devon Custard's topic in Home Cockpits
Updated tutorial on the hog wiki. That one works. Ive posted links to my github so you can download it directly from there. I also include the arduino LED circuit to test the master caution lamp with accompanying sketch and a testharness so you can test it without running DCS. Enjoy. http://deadfrogstudios.com/warthogpit/index.php?title=Connecting_DCS_to_Arduino Oh the images need a little tidying up, please excuse :) -
Question for panel makers - engraving.. how do you do it?
Devon Custard replied to Devon Custard's topic in Home Cockpits
I guess with a laser you can engrave reasonably deep. But the problem with laser engraving is the heat it generates, tends to melt paint!!! Finally got a working process, stumbled onto acrylic paints which can be used to fill the engraving and then the excess is simpled wiped away. Cut and engrave Base paint Dry Clear coat Dry Paint/engrave Remove excess Dry. Getting this to work for the CDU and UFC buttons has been a royal PAIN in the ass. However finally there i think... -
Question for panel makers - engraving.. how do you do it?
Devon Custard replied to Devon Custard's topic in Home Cockpits
Out of interest what kind of quality can you get with a CNC? how fine can you engrave? -
I designed my own project box, laser cut it and mounted simple tactile switches (from sourcingmap via Amazon) on matrix board. 100 x tactiles for £4!! http://www.amazon.co.uk/10mm-Tactile-Tact-Button-Switch/dp/B008DS1HV2/ref=sr_1_1?ie=UTF8&qid=1400517837&sr=8-1&keywords=tactile+switch+10mm Illuminated tactile for master caution from RS http://uk.rs-online.com/web/p/tactile-switches/6926999/ For the keys i reused the laser cutouts from the face plate and glued them to a piece of laser transparency. (thanks Tacno!) I have a brydling B256 board so im simply passing the tactiles back to that and controlling the LED on the master caution via an arduino using the sketch you find on my tutorial.
-
erm.... WOW?
-
Question for panel makers - engraving.. how do you do it?
Devon Custard replied to Devon Custard's topic in Home Cockpits
:thumbup:Actually i just remembered a cool technique, which im trying again. I remember doing this in school during arts and crafts but was reminded of this whilst reading Deadmans thread. So for engraved text, cut and engrave the panel. Paint it with the colour you want the engraving to show as in this case white. Fill the engraving with clay/putty whatever. Paint again with the top colour. Let it dry, remove the clay/putty with a tooth pick. Easy peasy. Great tip. Deads got a demo in his thread somewhere. (at least im pretty certain it was Deadman) -
Putting out feelers, who wants laser cutting services?
Devon Custard replied to Devon Custard's topic in Home Cockpits
Lets not get into it. I actually think the wiki is better way to help people and i can concentrate on that instead. There are enough laser cutting services out there and i was going to be spreading myself thin. Pitwife will definitely appreciate it i say im doing it so that i can do more work around the house..... -
Putting out feelers, who wants laser cutting services?
Devon Custard replied to Devon Custard's topic in Home Cockpits
Right, in answer to a comment thats been made to (about me) and this thread. Its been suggested that my recent wiki adventure is a ploy to generate business for my panel making ventures. Despite the fact that i only offered the capability to laser cut panels for peoples own designs i can see that people might think theres a bit of a conflict doing something for free (the wiki) and something not for free (selling my time cutting acrylic). Im moving house now and setting up my own personal man cave (joy!!!) so actually it comes at good time to make this decision. So im officially not offering services anymore, anything else i do on these boards will be free (always was anyway). Those who expressed an interest ill pm privately to see if i can help them if they have designs ready to cut. -
Question for panel makers - engraving.. how do you do it?
Devon Custard replied to Devon Custard's topic in Home Cockpits
Phil, its still a great technique. As im learning, as long as you are happy with the result, how you got there doesnt really matter. -
Announcing the Warthog Pit - A DCS Panel Building Wiki
Devon Custard replied to TigersharkBAS's topic in Home Cockpits
Much appreciated. Feel free to be part of it, we really want others to contribute, we're just facilitating the oppurtunity