MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
mbuto
Posts: 23
Howdy,
I'm working through this tutorial but no luck when I get to the test phase. I'm using the SG90 servo from my Arduino starter kit and I think I've got it wired correctly. Debug gives me this:

2020-06-04 12:10:10 AM(817): _syncFormToConfig : Parsing values
2020-06-04 12:10:09 AM(418): Command: SetServo <4,0,0;>
2020-06-04 12:10:05 AM(610): Command: SetServo <4,0,135;>
2020-06-04 12:10:05 AM(562): _syncFormToConfig : Parsing values
2020-06-04 12:10:03 AM(130): _syncConfigToForm : Exception on selecting item in Stepper Address ComboBox
2020-06-04 12:10:03 AM(129): Set in ComboBox: stepperAddressesComboBox
2020-06-04 12:10:03 AM(128): Set Servo in ComboBox: servoAddressesComboBox
2020-06-04 12:10:03 AM(125): Set 8 in ComboBox: displayLedModuleSizeComboBox
2020-06-04 12:10:03 AM(118): displayTypeComboBox_SelectedIndexChanged: Adding connected device: Servo, Servo
2020-06-04 12:10:03 AM(111): displayTypeComboBox_SelectedIndexChanged: called.
2020-06-04 12:10:03 AM(110): Set Servo in ComboBox: displayTypeComboBox
2020-06-04 12:10:03 AM(105): _syncConfigToForm : Exception on selecting item in Display Type ComboBox
2020-06-04 12:10:03 AM(105): Set Servo in ComboBox: displayTypeComboBox
2020-06-04 12:10:03 AM(104): Set in ComboBox: comparisonOperandComboBox
2020-06-04 12:10:03 AM(103): Set 4 in ComboBox: fsuipcSizeComboBox
2020-06-04 12:10:02 AM(955): displayArcazeSerialComboBox_SelectedIndexChanged : Problem setting Display Type ComboBox
2020-06-04 12:10:02 AM(955): Set Servo in ComboBox: displayTypeComboBox
2020-06-04 12:10:02 AM(937): Set 4 in ComboBox: fsuipcSizeComboBox
2020-06-04 12:10:02 AM(849): Set 1 in ComboBox: fsuipcSizeComboBox
2020-06-04 12:10:02 AM(848): Set in ComboBox: fsuipcSizeComboBox
2020-06-04 12:09:48 AM(498): Serialized Arcaze Extension Module Settings: <?xml version="1.0" encoding="utf-16"?>
<ArrayOfArcazeModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />

Any ideas?

Mike.
2020-06-04 09:28
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
Hi Again.

Please Confirm your first steps from other topic work fine now.
We not need to talk about problems with servos aslong you not get a working button/LED Input..... In easy words we need confirmation that the Mobiflight-->Sim Connection is fine already..... Your Mega work correct and so on.

About Servo.....
Best way to test is using the TEST Mode in Display Tab of your Config.
Same as i said in LED..... Not use a Offset or so for first testing.... Simply click this TEST mode to check if Servo basicly is connected correct and do what it should.

If NOT we must check your wirework, your device settings and so on.
If it work in Test mode then simply your config is wrong.
Good Luck !
2020-06-04 09:46
Avatar
mbuto
Posts: 23
Hello!

So to confirm:
- All other tutorials work OK, except COM display (no display available)
- I checked servo data sheet to confirm pin-outs since it's not marked on servo - confirmed OK
- Servo did work for the Arduino starter kit lesson
- I've moved the board off my powered USB 3 hub onto a USB 2 port on my PC. It does seem much more stable.
- Only defined device is a servo connected to pin 2
- Confirmed that config uploaded to board
- No FSUIPC config

Test on Display tab fails.

Can I test servo by applying 5V with no PWM signal?

Any other suggestions?

Thanks!
2020-06-04 22:23
Avatar
mbuto
Posts: 23
Update: I put the servo back in the starter kit config, and it works.
2020-06-05 00:07
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
Thats strange.

Your report sounds good. Nice to have a user who realy like to test and do tutorials.....

Badly i can not see your system.... Maybe a Discord session is the key. ( You can also talk to Stephan if he is Online..... Mostly in electrical quetions he got much more experience like me.... So Stephan = Electrical ..... Pizman = Config Formulas. Sebastian = Programming

About Issue.
Whatever the Motor is working in Arduino Situation..... This not means the Motor is compatible to Mobiflight. I personaly test Servos only with a SG90 Servo and it work for me.
In theory also most other Servos should work but i can not garantee.
Also there can be a issue in wire logic or in creating the Config i can not see without checking your screen.

What i would do.....
1. Restart of Mega and Mobiflight..... Using Mobiflight in ADMIN MODE ( Specialy if you set new devices a restart is often a good idea)
2. Using for testing a other Pin .... PWM is not needed for Servos as i know. Try another Pin between 2 and 53 ( NEVER use Pin 0 or 1)
3. Confirm there are no Resistors in your system..... And confirm you 100% know the 3 Pins of Servo ( GRD,5v Data)
4. Confirm Testing is set correct ( Max Rotation set to 100% and then click TEST below ) NOT use TEST in the Main Taskbar next to RUN and STOP button.... Thats for a other testing logic!

Finaly if all not help tell me what servo is doing..... Nothing, stottering, vibration, get it hot ?

I hope we can solve this together.
Good Luck !
2020-06-05 05:53
Avatar
mbuto
Posts: 23
Yay! all good now!

So I thought if servo is not moving, is it getting power? I put multi-meter on the wires coming out of board - 5mV - that's not right! I had though that wire needed pin 22, and that all pins on that side provided 5V, but of course, that is not correct. So connect to proper 5V and all is good :blush:

One question - Why is the bit mask set the way it is?

Thanks!

Mike
2020-06-05 20:48
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
iconmbuto:


One question - Why is the bit mask set the way it is?



You mean why this function exist or do you mean why it is preselected to all checkmarks active ???


Basicly you need to understand the Byte-Bit Logic. (Here a "short" overview)
A Offset have a size of 1,2 ,4 or 8 Byte. .... A Byte include always 8 Bits ( Bit 0-7 from Right to left) .
So for example a 2 Byte Offset include 16 Bits ( Bit 0-15 ... Here bit 0-7 is the first byte and bit 8-15 represent the second byte )

Each bit can only have a status of 0 or 1 .... Thats called boolean or "true and false" . Thats why people say a computer is silly cause it only knows 1 and 0 .
Also a High resolution Picture or a Audio/Video File basicly include just billions of 1 and 0....
If you type "test" on your keyboard the computer recive just a 32 numbers long combination from zeros and ones.


So if a Offset have for example the Value "7" that means it include a "binary" data .... So a combination of 1 and 0 that stand for "7" .... In that case 00000111
You can learn about that here ..... https://en.wikipedia.org/wiki/Integer_(computer_science) and here https://en.wikipedia.org/wiki/Binary_number
And check Stephans guide here.... https://www.mobiflight.com/en/tutorials/community-guides/working-with-digital-values.html



*****************

NOW to your Awnser.....


Most Offsets use the whole Byte to give us a information..... For example a 1 Byte Offset can include a Number from 0-255 or from -128 to +127
To get this number we need to read the WHOLE Offset ( means we must read all 8 Bits ).....
In case this methode i used in 99% of situations Mobiflight preselected all 8 Bits as active by the checkmarks by itself.
BUT
Some Offset also use single Bits....
Means ONE Byte Offset can include the Status of 8 single switches or LED.... Each Bit is a switch/LED here.
Like this....
iconQuote:

Radio audio switches. Read/write bit settings as follows:
2^7 COM1 transmit
2^6 COM2 transmit
2^5 COM receive both
2^4 NAV1 sound
2^3 NAV2 sound
2^2 Marker sound
2^1 DME sound
2^0 ADF1 sound


Here you can read/write the ADF1 switch e.g. by manipulation the "0" Bit on the right.
To read only that bit you disbale all other checkmarks ( from bit 1-7) so ONLY the "0 Bit" is currently readed or written.
NOTE: The Hexadecimal Number is just use to prevent of setting checkmarks.... Cause every Bit Combination can also be written with a 4 Character Number in Hexadecimal.

Summary:
This is mostly use for special offsets or in AddOns to save space..... If a Information is just 1/0 so if a function is just ON or OFF it´s not needed to waste a full byte if we can use 8 Elements in a Byte, too.

Hop you completly understand..... If not just ask me again !
Good Luck !
2020-06-06 08:17
Avatar
mbuto
Posts: 23
Thanks!

I'm a retired network guy, so subnet masking is a similar idea.

Mike
2020-06-06 21:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
Sorry about this.....

I not see if the user is advanced in computers or a completly beginner....

Whatever..... to much information is better as no information.
I think the question is solved :-)
Good Luck !
2020-06-06 23:22
Avatar
mbuto
Posts: 23
Yes and thank you!

BTW, since I'm in the home cockpit investigation stage, I have some questions as how best to proceed given my particular circumstances. For example, I need to build two sims. A 172 because I am a private pilot, and an A320/B737 because I'm really an airliner guy at heart. There's lots of ways to go, but it would be nice to get some advice on which path to choose. Would a Discord session with someone help?

Mike
2020-06-08 01:36
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
iconmbuto:

Would a Discord session with someone help?



I´m not a native english speaker.... But normaly it´s enough to talk together.

If you need basic informations and some guidence talking is much more profitable as writing 100 postings back to back.
Your Choice.... Call me in Discord OR write here specific what you need to know!
I mostly online on Wednesday and thursday evening..... German time UTC+2
Good Luck !
2020-06-08 10:37
Avatar
mbuto
Posts: 23
OK. I am P(acific)DT (-7). I think that can work.
2020-06-08 20:09
icon