Comments (14)
Have you tried with Putty to debug the communications protocol?
If in Putty your device responds with "@rel#ON@" but not with SerialCommUnity, then it may be your device doesn't respond with a newline at the end of the response. Could you check if it is that?
from ardity.
I'm quite new to the hardware layer :) I tried connecting to the device with Putty, but nothing happens. there is no prompt. When I set the wrong COM port, Putty says it cannot connect, but when I enter the correct one nothing happens.
from ardity.
There will be no prompt, it doesn't work exactly as when you use Putty to connect to a Linux server where a shell welcomes you.
In the case of COM ports, it will show an empty screen once connected, and everything you type in there will be forwarded to the COM port. So just go ahead and start typing your command.
You will find out if you need to pass a newline or not, and how the returned data looks.
from ardity.
Nothing happens when I write my command "@rel#1@", the device doesn't respond, nor behave like it should.
from ardity.
If you selected "Serial" as the "Connection type" in Putty, and are using the correct COM port, then the problem may be the command you are sending. You may check the manual for that device to know what it actually expects, it may be it expects a new line at the end, a null character, or to have a prefix before sending the message.
from ardity.
Putty is sending diffrent line endings than the one that my device is expecting, so it's not processing my messages. I don't have the time to diagnose it more - it's not key feature of my app :)
from ardity.
OK, if you later need it, in Putty you can press Ctrl+J to send a line-feed, and Ctrl+M for a carriage return. So instead of pressing the ENTER key, you make any combination of those two.
from ardity.
I'm trying to use SerialComm to retrieve data from barcode scanner. When I connect to it via Putty and scan a barcode the code appears on the screen. When I use included JustRead example, app succesfully connects to the device, but after scanning nothing shows up. What might be the problem? I'm using Datalogic Quickscan QD2430.
from ardity.
Hi Jakub,
The Unity part of SerialCommUnity needs a '\n' at the end of each message your hardware sends, it's with that line terminator that it decides where a message ends. Are you sure your hardware is sending that? If not, then the code that reads from the COM port in Unity needs to be changed so it knows when a message ends.
That's the first reason I could think on top of my head about why the library doesn't work with your hardware.
You mentioned a JustRead example, is that an example for your specific hardware? I couldn't find it online to take a look to that device's protocol.
from ardity.
You were right. It was all about the line terminator. I found this example:
https://code.msdn.microsoft.com/windowsdesktop/SerialPort-brief-Example-ac0d5004#content
with reading data by bytes and the data is read but it waits for the terminator to dispatch. Probably that was also the case with my previous question. By JustRead example I meant DemoSceneUserPoll_JustRead scene you provided.
from ardity.
OK, in that case, it is all about changing the line of the library how to detect an end-of-message. For some devices, all messages are of a fixed length; in others, there is special char terminating the message (like a '#', '.', '\n', etc.).
from ardity.
I was able to send data to my USB Based Micro controller (Maple Mini) but can not receive data from it . Tested with the Demo scene DemoScene_AutoPoll from the package . Tested it on putty and it works fine was able to log the data recieved from Port .
from ardity.
Hey thanks solved it be enabling DtrEnabled flag .. which is by default set to false :-)
from ardity.
Good to hear it's working :)
from ardity.
Related Issues (20)
- queue is full dropping messege HOT 8
- Works In Editor but now on windows build HOT 3
- From Unity to Arduino HOT 2
- Working with BLE and Mobile HOT 3
- Can ardity read serial information from arduino attached to an android device via usb c (unity android build)? or is it only for windows?
- The Data is visible in Arduino serial monitor but not reciving in Unity3D HOT 1
- Can't compare strings (sorry am noob) HOT 1
- Game crashes when exiting HOT 2
- cant find the COM HOT 2
- PortMapper trial HOT 2
- Does Ardity work on Linux ? HOT 1
- Dropping too much messages when frame rate is below 100 fps HOT 3
- Flooding queue when device is removed unexpectedly on linux HOT 5
- how to use aridity to send byte HOT 6
- Use with Mobile HOT 1
- Unity Package contains un-update source
- Windows 11 - Exception: Access is Denied HOT 1
- Sending data from unity to arduino
- Thread is blocking for readTimeout even when no data is available
- A specific question HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ardity.