Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by absorkam · Mar 02, 2016 at 12:49 PM · androidunity 5serialport

Android to single board computer over serial error

I am trying to open a serial port on Android to communicate with a single board computer. I load the Unity application on Android. I do the set up and it seems to work fine.

stream = new SerialPort("COM4", 9600);

No error so far. But when I try to open the stream:

     try{
         if(!stream.IsOpen){
             stream.Open();
         }
     }catch(Exception f) {
         myText.text = f.Message;
     }

I get MonoPosixHelper exception I have seen some posts on this, but I haven't seen anybody resolve it yet. Does anybody have any suggestions? Developed in Unity 5.3 and running on Android. I have tried it on several different boards, Arduino, Pi, etc. etc. all the same error. I do have .Net2.0 turned on, turned off .Net2.0 subset in player settings.

Thanks

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fallouturama · Aug 11, 2016 at 12:37 AM 0
Share

I've added to Android$$anonymous$$anifest.xml:

 <uses-feature android:name="android.hardware.usb.host" />

And even tryed to open any other /dev/ with the same code and I get same $$anonymous$$onoPosixHelper exception

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by absorkam · Mar 03, 2016 at 03:29 PM

I also have tried ttySo, ttyS1.......com1, com2........etc. etc. That could be part of my problem I'm not sure which com port to use. I printed the available serial available and got ttyS0 ....to.....ttyS3........but none worked.

Next, I'm going to try to program an Android Plugin and see if that works.....but would really like to know if anybody has got this working or knows my problem.

Thanks absorkam

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image absorkam · Mar 07, 2016 at 04:00 PM 1
Share

$$anonymous$$aybe if I keep answering my own question somebody might see this that will have an answer. I got it running fine in Android Studio, still no luck with the $$anonymous$$onoPosix Error in Unity. looks like the $$anonymous$$ono libraries have been scaled down and whatever the SerialPort needs was stripped out? Still not completely sure.
I started making my Studio project a Unity plugin. $$anonymous$$aybe I could do that and then sell it on the store.............

avatar image Fallouturama absorkam · Aug 10, 2016 at 03:11 PM 0
Share

That sounds posible to me, so on Android Studio is working?

Any news on Unity?

Have you confirmed if the library has been scaled out?

Have developed a library/plugin?

I'm about to commit suicide here...

avatar image Fallouturama Fallouturama · Aug 10, 2016 at 03:17 PM 0
Share

Scaled out theory for non Windows boxes: http://forum.unity3d.com/threads/monoposixhelper-not-found.99951/#post-685579

avatar image
0

Answer by pengyuenhao · Apr 14, 2016 at 02:09 PM

I am same as you... do you know what happened? if you get answer,please tell me,thank you very much pengyuenhao@qq.com

be friends ,will?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fallouturama · Aug 10, 2016 at 02:55 PM 0
Share

Same error here. opening /dev/ttyA$$anonymous$$A0 in my device, and any other similar device found on /dev/ causes the same $$anonymous$$onoPosixHelper.

Permissions problem? Native library opening this devices not implemented? Already opened ports?

Any workaround?

avatar image
0

Answer by Fallouturama · Aug 10, 2016 at 03:47 PM

This may be a valid workaround:

  1. Export Unity Project as Google Android Project.

  2. build libmono.so with the same version of Android Studio that make serial io work

  3. Replace libmono.so in the Google Android Project

Anyone can confirm if this is posible? @absorkam? @pengyuenhao?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by andor734 · Jan 18, 2017 at 12:36 PM

It might be raising a DLL not found exception. Basically the version of .NET 2.0 running on Android doesn't include the SerialPort class... Though why that's the case, I don't know.

Currently trying to figure out what the problem is.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to move character forward and also face moving direction ? 1 Answer

Unity Daydream Preview - Raycast/camera alignment 1 Answer

jni error has occurred local reference table overflow (max=512) Android crashes on start. 1 Answer

voice recognition 2 Answers

Android game updater (autopatch) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges