I think it might be the raspi-config. I don't remember it I enable serial communication or not. The operating system is a an image I saved before. I think it should enabled the serial. But I will double check tomorrow.

    zhanghaijason

    A straight way to separate the problem is to connect the MindRacer to QGC through USB2 port. If succeed then it shows the USB port works fine. The problem is mostly on Raspi side.

      rolandash Hi Thanks for the tip. It turns out it is the USB2 not working. Is it because of the expansion board or the mindracer? Which one do you think is more possible? And could you teach me the 2nd method using telem 1 if when you have time? Thanks.

        zhanghaijason
        But the problem now is Telem1 seems not working properly?
        I think better to make sure Telem1/2 not been already physically damaged first.

          rolandash As we talked before in the other post, when using mindracer to power the TFmini, Telem1 can work with TFmini (I would say 70% success rate) when only using USB to power the mindracer. But definitely not working when using battery and the MRPDB to power the mindracer.
          Then I followed your advice to use the MRPDB 5V BEC to power the TFmini.

          Now I use multimeter tested the output of Telem1 when mindracer is powered. VCC 5.08V, FMU_TX 3.23V, RX 3.23. Telem2 VCC 5.08V, TX 2.9V, RX 3.2V. Are there anything else I can do to test the Telems? And NO OUTPUT from USB2.

            zhanghaijason

            That should not happen. USB2 VCC can not be 0V, especially when you have Telem1 VCC as 5.08V, as they are all connected.
            If that is true, then must be something wrong with the expansion board. Check the contact of USB2 socket on expansion board. check the pin1 of USB2 and pin 2 of J3, make sure they are connected.

              rolandash pim 1 of USB2 and pin2 of J3 are connected. And I double checked the USB2. It is giving 5V on VCC. I think my last measurement was wrong.

                zhanghaijason I tried method 2 and used /dev/ttyAMA0, not USB0, now it seems working, the ROS can get the FCU heartbeat. I will try offboard mode to see if it is really working or not.

                  zhanghaijason

                  To use Telem1 for onboard computer, make sure telem1 baud rate setting is the same as in Raspi side.
                  Seems in later px4 firmware version you do not need to change source code to set that. You can set in QGC through parameter:
                  SER_TEL1_BAUD
                  on the fly.

                    6 days later

                    rolandash Hi sorry for the delay. It worked once. I tried 3 or 4 times with offboard hovering. Only succeed once (Everytime, It could switch to offboard (If I publish the local position with ROS before switching mode), but only took off and hovered once.) I don't know it is because I am using raspi 3A+ (less powerful) or not. I will receive some raspi 3B+ tomorrow and will experiment more.

                      rolandash I can switch to offboard, because the green LED blinked when I switch. However, I use a mavros etpoint_position/local topic to publish desired local position (0,0,0.7). The drone won't take off and hover. And I saw a massage from mavros says "No local position". So I am wondering if the distance sensor and optical flow can publish local position or not (or may be not fast enough, it is only 10hz in GCS). I uploaded one of such logs: https://review.px4.io/plot_app?log=01cd4714-6b13-45f0-ad20-c65ca3478ce5 I also tried telem2, same result. I may need to ask mavros developers to see what should be the possible reason. Thanks.

                      I tried two more times and now it can take off. one crashed and one succeed. I am just confused why it is kind of unreliable.

                        is the uploaded log a successful takeoff or failure?

                        Do you always get "no local position" message even when success?

                          rolandash The log is a failure. The drone didn't take off at all on this log. When I succeed, I didn't see 'no local position'. I think it might be the problem of the optical flow and distance sensor positioning system. Because when I tried with Optitrack for positioning. It worked well.

                            zhanghaijason
                            As the discussion is more related to PMW3901 so I will move to that thread to continue instead of getting this unrelated post too long...

                              3 months later

                              rolandash Just pay attention as no flow control line on Telem2 so mind your data rate setting not to exceed the processing speed of CPU on both side

                              Hi Roland, recently when I fly the drone with offboard mode, the drone loses offboard command very often. The error in mavros is : "Failsafe enabled: No offboard". The ros rate I set is 100 and the topic (mavros/setpoint_raw/attitude) buffer size is 5, 1 or 10 (I changed to different sizes to see it it can solve it). And i am using Telem2 by removing R34. Is what you said the reason why the failsafe always be enabled?

                              And I also tried to use Telem1, however, when I change mav_1_config to telem1, reconnect the USB to mindracer. I cannot see mav_1_mode, mav_1_forward, mav_1_rate (can be seen if change mav_1_config to telem2). And when i use the motion tracking system, the topic mavros/local_position/pose is published very slowly with wrong numbers (The output from motion tracking system is relayed to mavros/vision_pose/pose, it is correct).