Making a WCF test app for 2 separate machines RRS feed

  • Question

  • User2142845853 posted


    Im trying to grasp WCF concepts, and have an application where I have a small embedded board with wifi and wanted to connect that to some app in windows using WCF somehow to make a continuous connection over TCP

    Will assume that the wifi router is able to connect 2 local wifi devices as a local 192.168 IP?   The goal is to stream data both ways, the embedded board has a temp and light sensor and is in another room, Id like to display the streaming data in a windows app using WCF and C++ or C#  ? 

    Are there code examples for Visual Studio to do this? am searching and will post back if I find any thanks

    edit to add:  it could be apps in 2 different PCs just to test it, both have visual studio.

    Sunday, January 17, 2021 3:01 AM

All replies

  • User475983607 posted

    I've build many embedded network projects.  Most likely WCF (SOAP over HTTP) is not the right protocol for your project.  The sensor data will be around 5% of the SOAP message.   XML, JSON or, multipart/form-data over HTTP is a much better protocol because it works out-of-the-box with any web server or REST service.

    It is important to understand that HTTP is request/response protocol.  If you want more of a streaming connection then drop down a layer below HTTP and use your own protocol over TCP or UDP sockets. 

    Unfortunately, you have not explained your configuration well enough for me to provide an accurate solution.  I'm assuming the embedded devices are stand alone WiFi enabled.  Typically, the Wifi chipset and software driver illustrate how to send a TCP or UDP message. 

    Sunday, January 17, 2021 12:37 PM
  • User2142845853 posted

    Great, well the 1st one is an ESP32 micro controller board with bluetooth and wifi.   Its setup to control the furnace downstairs.  Why buy a thermostat for $18 when one can wire in this board to the relay and control it remotely?   The kids shot the thermostat with a bb gun so the LCD is now black (back in 2015 or 16) So there is this ESP32 and some 5v power brick thing and wires going into the thermostat.

    I can use a serial bluetooth terminal to send commands to the board to turn on/off the furnace.  works with phone or pc. 

    But I want to get more familiar with any software tools that connect to other points and share data. Id like to have a windows app that displays a chart of sampled data, remote measuring is what it would be.  So in the windows app is a box and on the right the new measurement appears, all the other measurements shift over by 1.  Each measurement has a time stamp, as the data comes in it can be displayed in this box, there are clear and save buttons.  

    Goal is to have the ESP32 send temp data of that room by a connection and its displayed in the windows app in a box graphically.   what would really be great is to have this as a digital o scope setup next.  Yes the commercial ones work great, I want to make one.  I made one in the 80s with mostly ttl and analog parts, to measure voltage in Arc welder machines, hooked up to my analog scope and worked perfect.  Was just one of the things the moving company stole with a cross country move.  alot of years of stuff in a few boxes, all stolen.  too bad, you didnt buy insurance, nothing we can do.  Anyway a digital o scope app would be good, I need that often;

    Another thing is to have one of these in my truck.  I have small wet cell sealed batteries that are 6x2x4 or so for power to be there listening for any alarm condition.  Used to get gas stolen, put a video camera in the window and parked backwards so I can see the gas tank side? didnt work well. Now years later someone stealing gas again, think its a neighbor, they leave a 5 gal red thing outside and Ill have 1/4 tank left and next morning its below 1/8.  its that kind of neighborhood.  Other neighbor started their car in the AM let it warm up, went back inside? someone drove it away. found crashed days later.  Not like the place we came from, you could leave keys in the car and house unlocked.  Here any trash left near the street? roving bands of trash pirates pick it up in hours.  We were swapping a car battery, left 2 outside by our car, went in to have breakfast, came back 15 min later, both were gone and thats in a much nicer area a mile from here.  Not to mention some drugged out guy smashed my front/back windshields, slashed 2 tires on my suv.  Later found out who, mistaken identity. The guy apologized, was mad and said he would go beat the c...p out of those people (another neighbor) for telling him to do that and giving him drugs? I said no dont worry.  And the alarm did not go off. So Id like some device that can make a TCP connection that has at least a microphone? maybe motion detector (have a gyro sensor chip) and I have a wifi video camera that has a motor to move it around.  but it detects so many events there are 100s on any night I gave up sorting them.   shooting happened across the street so I gave police online access to my video security camera and sent the files to them, but it was not high res enough.  And that was years ago.  Until we can move, I tend to not see or know anything thats not my business.

    id like to be able to have this TCP connection to the video camera I want in the truck, not just their wifi software which is cheap and sucks; I want to connect to the wifi camera, control the axis and listen to audio with my own microphone setup, or be able to use a relay to turn lights on/off, lock doors or whatever.  So a connection, TCP over wifi that can stream back/forth.   I wouldnt go into all the miserable detail but thats the motivating factor here; I want to get better at connection software and have a need for 1. thermostat and 2. vehicle security

    Sunday, January 17, 2021 6:58 PM
  • User2142845853 posted

    To test I need a way to have a TCP connection between 2 PC's that I can send data from several sources and decommutate on the other end.  Seems like I have to have some cloud resource, even a 3rd pc that runs connection management software,   so I have a website with a URL and then 2 different PCs have software that will go to that site and subscribe and then if the other subscribers are all shown publicly you can connect to one of them.  I used this kind of software in 2012 and cant recall what it was.  If I recall its used in things like social media or might have had some IoT applications also  but it was a protocol or kind of connection engine thats open source/free

    Monday, January 18, 2021 2:26 AM