Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages not showing #45

Closed
brollsroyce opened this issue Aug 25, 2020 · 7 comments
Closed

Messages not showing #45

brollsroyce opened this issue Aug 25, 2020 · 7 comments

Comments

@brollsroyce
Copy link

Hello,

I followed the pdf with steps to get incoming messages into Unity from the COM port with the 'MyMessageListener.cs' script.
Upon pressing play, the only message I get is "Device Connected" and no more messages. I checked if the device is sending data via a python script and yes it is constantly sending data.

I have 2 suspicions:

  1. The data being sent from the device is in the form of hex bytes (as shown in the image). Is that a problem? Also, they come as packets.
    packs

  2. Does it matter if the device is arduino or not?

@dwilches
Copy link
Owner

dwilches commented Aug 25, 2020 via email

@brollsroyce
Copy link
Author

brollsroyce commented Aug 25, 2020

I'm sorry I have no idea what dts and rts means. There is no such flag in the method you indicated (see image).
image

Could you write the lines of code that I need to add to the AttemptConnection method here?

@dwilches
Copy link
Owner

Hello,

Sure, no problem. Please locate these 2 lines:

serialPort.WriteTimeout = writeTimeout;
serialPort.Open();

And in between them, enable DTR and RTS like this:

serialPort.WriteTimeout = writeTimeout;
serialPort.DtrEnable = true;
serialPort.RtsEnable = true;

serialPort.Open();

Let me know how it goes,
Daniel W.

@brollsroyce
Copy link
Author

brollsroyce commented Aug 26, 2020

Hello,

It looks like there is progress after enabling DTR and RTS. I was getting the messages 'Arrived: I????' repeatedly (happened only once, directly after I made changes to the code), but I don't have a screenshot of that, because I cleared the console. But after that whenever I press play again, there were no values coming, just the 'Device connected' message and when I disconnect and reconnect the device, the message in the image below appears.

image

Again, to double check, I checked if the values are actually being sent by the device via my python script, and yes they are being sent, but not to Unity apparently. :(

Any ideas?

Really appreciate your responses btw.

Thanks,
Brolin

@samu158820
Copy link

I'm having the same problem...
Btw, I'm writing in arduino in C language, using Atmel Studio and flashing with AVR8.
Verified the port with arduino IDE monitor, and it indeed send the messages, but Unity just don't receive/show them.
Please if anyone find the solution I would be grateful!
Sam

@dwilches
Copy link
Owner

Hello @samu158820 ,
In which scene are you experiencing the issue? and what is the delimiter of your data?

Notice that scenes like DemoScene_AutoPoll expect the data to be sent in lines, while the scene DemoScene_CustomDelimiter allows you to set a custom delimiter. So depending on the format of your data you need to use one or the other to test your device.

Regards.

@samu158820
Copy link

samu158820 commented Sep 20, 2020 via email

@dwilches dwilches closed this as completed Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants