Send data from one Wemos to another [closed] - send

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have 2 Wemos d1(retired) boards. I just simply need to send some data or a letter from one to the other. I searched the web deeply and found some complicated NodeMCU stuff and so on. Even though I could send data when I flashed NodeMCU to my Wemos, it was useless because my project is about arduino. I need to work with Arduino IDE. There is also a way to create a WebServer on one of the wemos and then deal with html files. But isn't it so complicated for just sending a couple of bytes? I don't need any webserver or html page. So please help me.

So, just use basic TCP socket communication. Assign one of them as a server. Here are libraries to use for arduino :
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiServer.cpp
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClient.cpp
Here is a WiFiClient example :
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
Here is a WiFiServer example :
how create TCP server by ESP8266?

Related

How to consume data from url [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I have url address which accept data from 3rd party server. How can I consume the data from that url? I know that this url accept only post request. So how I can I receive that data in my kotlin app?
This is usually done by using an HTTP client library, so you can more easily convert payloads etc.
There are many HTTP clients to pick from. Among them are Ktor client (Kotlin-first, coroutine-based), Retrofit (very classic on Android), or even the built-in JDK11 HttpClient (although this one is not very Kotlin-friendly), but also many others.
If your code is multiplatform, Ktor would be a particularly good choice.

Communicate between 2 applications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have written a basic VB winform application (in visual studio) that control the lights. I published and create an install package so I can install this on other PCs.
My questions is how to sync these applications to communicate with one another so if I turn a light on, on one PC, other PC will sense that and display it on thier application.
I can use timer to see if there are any action every 15 second, but I don’t think this is efficient way.
Take a look at this question that involves sending information between computers over a network. You could have the program send what it did to the lights so that the other programs can update themselves.
I'd suggest you look at writing the status to a file accessible to all on the network, use the filewatcher class to detect changes to the file, and when the file changes read it from all PCs to see the current status of everything.
ref: https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx
another option would be to use UDP broadcasting

Multiple programs on AVR atmega [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to make my Atmega robot to operate multiple modes (line following, obstacle avoidance, direct guidance from PC ) How can I load these separated programs on flash and how to select one of them when restarting the robot?
The easiest way is to make one big program with all the functionality of all the modes. On startup, in main() check if certain buttons are pressed, then choose which mode you are going to operate in. Then only use the functions and control mechanisms for that mode from then on. The rest of the code just sits there unused, but it would anyway in any other scheme.
There isn't an easy way to break the code into several different complete programs. For example, the vector table is fixed to be where it is. You would have to have the interrupt handlers check to see which mode is active then call the appropriate function for that mode.

Getting Mac system temperatures with Objective-C [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How do I access the system temperatures and fan speeds of a Mac using Objective-C? I have seen it done in applications like iStat, but I can not figure out how to do this. Does anyone know how?
You may also take a look at https://github.com/fmorrow/SMCWrapper - it's an object-oriented version of smc.c/smc.h. (The code of SMCWrapper is well commented)
Currently, it opens a connection using IOKit to AppleSMC IOService, and uses it to makes calls to the SMC chip. You can read keys to NSString, but setting key value is experimental at this time.
Take a look at https://github.com/lavoiesl/osx-cpu-temp/blob/master/smc.c for sample code that reads the temps from the SMC.

How to sync the data with web server once device came into network? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
In my app which is data collection app i need offline support. Let's say when i am gathering user's data there is no connection on device but once the device comes in network the whole data should automatically goes to the server.
How should i implement this kind of functionality.
Thanks,
Your question is pretty vague, but I assume you're wondering HOW to persist data and not how to automatically send it to the server.
If the data is very simple, NSUserDefaults may suffice.
If you need a bit more complicated data structures, you can use archives.
If you need to store complex object graphs you need to use Core Data.
There's a pretty good guide explaining all of these here.