Arduino write on standard firmata, using c# SerialPort.Write() [closed] - c#

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
so, I'm super new to using an arduino, and I can't seem to understand what happens when I do SerialPort.Write() to one. like, what function within the standard firmata occurs?

When the computer sends data to the arduino trough a serial port, the arduino receives that data and stores it in a buffer until your arduino code does a Serial.read() (or any other variant used to read the serial data). Once the data is read, the buffer is cleared.
It's worth noting, however, that the handling of the usb comunication is NOT done by the arduino's main chip (the one in which your code runs), but rather in a separate chip installed on the arduino board solely for this purpose. The arduino library's Serial class handles the communication between the main chip and the one that handles the usb comms.

Related

C# NetworkStream Write/Read vs Socket Send/Receive? [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 2 years ago.
Improve this question
Which one is faster than other? I am building a server-client app but I am not sure which one is faster. I can smoothly send and recive data with both but I want faster communication.
The NetworkStream is using sockets internally to operate. You can understanding by looking at the constructor of it in the Microsoft documentation.
public NetworkStream (System.Net.Sockets.Socket socket);
It provides you with methods that you can use to Read/Write to the stream easily.
The Socket class on the other hand provide you more control on what kind of data you want to exchange in the network. If you intent on exchanging data via TCP protocol in the network you will probably see no difference in the transfer speed by using Either Socket or NetworkStream.
If you need to exchange data with faster communication, consider using UDP protocol by using the Socket class but keep in mind that the UDP protocol is not connection oriented like TCP and no error checking occurs. As such you can't be sure of the reliability of your data and the guaranteed delivery of them.

How to perform an action on a C# application after pressing an Arduino button? [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 3 years ago.
Improve this question
I am doing a school project where it would be nice to perform actions in a c# application by pressing physical Arduino buttons.
I have seen plenty of tutorials on how to perform actions in Arduino by pressing buttons in c#, but none of this reversed. I only saw somewhere that I needed to add a "serial port listener" but it wasn't explained and I don't know this term.
Can anyone help me with this?
You can write a C# (.net) program that listens/writes to the serial port the arduino is connected on
Microsoft's page on how to write data from a .form application to a serial device
The arduino can read incomming serial data periodicaly using the following example:
Arduino code on how to "listen" to a serial port
This is just a starting point..
edit: I now see you are asking for the "from arduino to PC" button interaction!
Just send a character over the serial port from your arduino:
send a character over serial with arduino
Receive the character in your windows application:
read a character in a .net application

PC to a Raspberry-Pi via a TCP/IP socket? From C# to Python [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 3 years ago.
Improve this question
I am trying to do wireless communications between a PC and a Raspberry Pi using python's socket module. The problem is that the program on the PC is programmed in C# but the Raspberry-Pi is programmed in Python. How can I send a string from my computer so that the Raspberry Pi programmed in Python can read it?
A protocol like this is language-independent. That is one advantage of having such a concept.
If a server receives a connection request, it doesn't know or care what kind of code was used to create the connection and send the data (someone could even be typing it in by hand, in theory), all it cares about is that the data being sent is in the correct format (as defined by the protocol) and the messages follow the correct sequence etc, so that it can understand it.
This applies to all sorts of commonly-known protocols, such as TCP/IP sockets, or higher-level protocols which build on that, such as HTTP or FTP.
So as long as you know how to create code to initiate a socket connection in language A, and code to listen for connections in language B (or C or D, or even A again), then everything should work correctly.

How to show and block incoming UDP packets [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 7 years ago.
Improve this question
How to show and block ip UDP incoming in c# WinForms.
Show ip and incoming packet in label like Anti DDOS Guardian
I made a similar application some years ago using WinpkFilter. I don't know if there is something better, but this gives you all that need to read all packets passing on network interface. Once you read the packets, you can check protocol type and make all operation you need to prevent DDOS.
You have to install the WinpkFilter driver and link the ndisapi.dll library, I suggest you to give it a try and see if this can help you.

finding type of a dll functions ? how to see them? [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 8 years ago.
Improve this question
I am developing a .net program that needs to communicate with a magnetic card reader/writer.
it has a DLL but i couldnt find its functions and the producer company told me that i have to use only with serial port commands.
In its manual, there is some commands that has been explained not clear enough ! I tried to use them but i couldn't get any response for non of commands.
Does any body has experience with card reader devices ?!
Is there any handshaking or initialization i need to set ?!
My card reader model is : Skankyo 6940
As said Dennis asking a vendor and reading its docmentation is more productice and most accurate way you can approach to work with the library .
Alternatively you may think of using: DUMPBIN.EXE utility, to dump all export functions of that (presumably C) dll. I repeat,in this way is much harder then reading a documentation, but, yes, you can also find some "hidden gems".
Hope this helps.

Categories