EMLID Community and Support Personnel:
I am trying to write PWM signals directly to the output rail without going through mavlink, mavros, ardupilot, etc. I have gone through the examples provided as part of the information for developers as well as searched through the source code and documentation published on GitHub. I have also searched through the forums and cannot find one that pertains closely. The closest I can find are these two:
The second link asks that the alive status is pinged.
sudo cat /sys/kernel/rcio/status/alive returns a “1”
If I missed anything else in the forums then I apologize.
Before I continue, yes I have checked all wiring, tried to reboot, powered the Navio2 directly, ensured good connection between Navio2 and Raspberry Pi 3 B, etc. I have also reflashed the unit to ensure that I am using Emlid’s official iso image, 4.14.34.emlid-v7+. The general solutions do not work in this case.
The end goal of this is to use my custom flight software instead of an off the shelf one such as Ardupilot (in this case) or PX4/APM. I am a pseudo flight control engineer and need to test my software against others. I am also using my custom ground station and not QGroundControl or others like it. All of my message handling has been unit tested and found to be correct.
Currently, I am able to read all sensory information from the Navio2 unit (acceleration, gps, barometer, rc unit, etc). When I run the Servo (c++ and python, as sudo) example, the program will run but nothing happens.
Please correct me if I am wrong; however, it looks as though both scripts are writing information to:
“/sys/class/pwm/pwmchip0/*”.
I’m going to use python here since it’s easier to visualize in forums for me…
In the Servo.py script, I printed out pwm.is_enabled and pwm.is_initialized. Both print as “True”.
- The program does not write the channel path:
SYSFS_PWM_PATH_BASE = “/sys/class/pwm/pwmchip0/”
self.channel_path = self.SYSFS_PWM_PATH_BASE + “pwm{}/”.format(self.channel) - List of files in that folder are: device export npwm power subsystem uevent unexport
- */pwmchip0 has read, write, execute ability
Question 1: Is there any reason why the script cannot create a folder or file in that directory. I do not get an error message stating that it cannot.
Question 2: I could not find anything in the image, scripts or files that looks for those written files (grep commands). Is there a distinct location I could look at to see the message handling/calling this?
Question 3: Is there a command that I am missing that allows me to write/publish directly to the pwm rail?
I hope that this made sense and I appreciate everyone’s time in resolving this issue.