Problems using AHRS IMU: no hardware connected to port?

Official forum for open source FreePIE discussion and development.
Post Reply
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

Hi,
I am having problems with AHRS IMU.
I'm trying to run the head-tracking part of this project:

http://mclightning.com/openvr-2-software/diy/

So I upload this code to my Arduino with no errors:
https://github.com/ayildirim/OpenVR/blo ... o_code.ino

Then i can see at the monitor serial values, changing very fast, like this:

#YPR=-65.61,-2.67,16.80

Arduino is at COM 10 and baud rate 57600.

I open FreePIE (1.5.475) and load this code (i'm interested in TrackIR code):
https://github.com/ayildirim/OpenVR/blo ... %20GY85.py

Then i go to Settings>Plugins>AHRS IMU and set Com port to "10" and Baud rate to "57600"

I think i'm doing it well, but when I run the script... I always have the same error:

"No hardware connected to port COM10 with AHRS IMU protocol"

I googled for some help, but I only found references to check the number of COM port.

Please, can anyone help me?


Regards!
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

Please, take a minute to read my thoughts about it:
(sorry for my English...)

Looking at AhrsImuPlugin.cs code, I can see some serial commands launched:

Code: Select all

serialPort.Write("#ob"); // Turn on binary output
            serialPort.Write("#o1"); // Turn on continuous streaming output
            serialPort.Write("#oe0"); // Disable error message output
And the last of them is:

Code: Select all

serialPort.Write("#s00"); //Request sync signal
Then the code wait for a response in a determinated format:

Code: Select all

while (serialPort.BytesToRead < "#SYNCH00\r\n".Length)
            {
                if (stopwatch.ElapsedMilliseconds > 100)
                    throw new Exception(string.Format("No hardware connected to port {0} with AHRS IMU protocol", port));
            }
And if the time is overcome, throws the error i'm getting.

In the Arduino side, i see the answer to the SYNCH request is:

Code: Select all

// Reply with synch message
        Serial.print("#SYNCH");
        Serial.write(id, 2);
        Serial.println();
So I can´t see what is wrong with it.
I need help.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

Code: Select all

#YPR=-65.61,-2.67,16.80
Is text format, FreePIE sets binary mode with command

Code: Select all

#ob
So something is probaly wrong with your firmware, it looks like its a port of the actual code?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

One thing you can do if you dont get your firmware to respond to the commands is to change the code here

https://github.com/ayildirim/OpenVR/blo ... ut.ino#L14

and make it output the Free_IMU text format

Code: Select all

  Serial.print(TO_DEG(yaw));
  Serial.print(",");
  Serial.print(TO_DEG(pitch));
  Serial.print(",");
  Serial.print(TO_DEG(roll));
  Serial.println(""); 
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

I get the values in text mode (monitor serial #YPR=-65.61,-2.67,16.80) before run the freepie script.
Then i close the monitor serial and run the freepie script.
After run freepie script (and get the error) if i open the monitor serial i can see binary values.
So the commands was ejecuted.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

The code was written against a Sparkfun razor with firware v1.4.0 installed, shouldnt matter but to rule it out, please try version v1.4.0 on your board
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

I don't understand.
Please, explain it a little more
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

I just tried it with 1.4.0 which works, there is no reason why 1.4.2 shouldn't work, but please try.
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

I'm afraid it still doesn't work.

And i don't know what to do :oops:
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

I cant reproduce your problem so its hard to try, I will upgrade my AHRS to latest version when I get time and see if its the version thats causing it.
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

Cybervillain, i'm using an Arduino Leonardo (pro micro) with GY-85 MPU
When you talk about AHRS firmware, what do you mean exactly? To the arduino esketch used or anything else?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

Firmware is a bad word, sorry,the software loaded onto the board. I didnt have time to load the latest AHRS software during the weekend sorry. I'm still on 1.4.0 on my board, and it works
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

Oh! I see.
I would load 1.4.0 on mine and try with my mods (to work with gy85)
Please, where can i find that version?
I only find the last version
Or can you share your code, please?
Nakon
One Eyed Hopeful
Posts: 38
Joined: Thu Sep 04, 2014 6:40 am

Re: Problems using AHRS IMU: no hardware connected to port?

Post by Nakon »

I think i found 1.4.0 versión:

https://github.com/ptrbrtz/razor-9dof-a ... r_AHRS.pde

I'll try
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

cool,let me know.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Problems using AHRS IMU: no hardware connected to port?

Post by CyberVillain »

I tried with version 1.4.2 from here https://github.com/ptrbrtz/razor-9dof-ahrs

Worked right away
Post Reply

Return to “FreePIE”