Git Product home page Git Product logo

mobiflight-firmwaresource's People

Contributors

docmoebiuz avatar elral avatar giocc avatar mobiflight-admin avatar neilenns avatar psychokiller1888 avatar ssewell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mobiflight-firmwaresource's Issues

Update the readme with better instructions

The readme now is basic and should include links to the necessary extension as well as some additional details on how to build a release version of the firmware to include in MobiFlight releases.

Support Arduino Nano

Firmware companion to MobiFlight/MobiFlight-Connector#579.

This will require:

  • A board.h file based off the Uno board
  • A new entry in platformio.ini to generate Nano builds

No change to the GitHub build process is required, it was designed from the start to expect more Arduino boards in the future.

ProMicro filename is wrong

It's currently "promicro" and should be just "micro" for backwards compatibility with the old firmware process.

Servo smoothing not enabled in current firmware

Previously, MFServo used a technique to incrementally move the internal representation of the servo position towards the desired target position over time in conjunction with a deferral for N milliseconds before adjusting the servo position.

This deferral feature was removed in MobiFlight/MobiFlight-Connector@379c5a2

The current behavior exhibits jumpy behavior, as the servo quickly reaches the target before the next configuration timer tick takes place.

Uncommenting this following line in MFServo::update() re-enables the deferral feature, resulting in a smooth servo transition:
//if ((millis()-_lastUpdate) < 5) return;

Results were tested using a SG90 servo with a timer interval at several points from 100ms to 500ms, inclusively, with satisfactory results.

Verify all the board-specific #define values are correct

Elral moved the board-specific #define values out into separate files. Double-check they are all correct. It would be bad if my random changes for other things unrelated to this work somehow made it into this repo introduced an error in the values!

Config memory location can get overwritten in certain conditions

From @elral

Within readConfig() readBuffer[MEM_LEN_CONFIG + 1] is defined and a RAM area is reserved. Then the config (String cfg) is copied to readBuffer[].
In the nexr steps readBuffer[] is processed, all "." and ":" are exchanged to NULL (string termination) and for each device pointers are defined which are pointing to this reserved RAM area.
At the end of the function readBuffer[] this RAM area is released, but the pointer are sstill pointing to this RAM area.
In the following program it can happen, that additional RAM is required and that the remaining RAM area is not sufficient. In this case the released RAM area from readConfig[] is used and the config is mixed up.

ProMicro crashes after uploading a new configuration

This has to do with running out of memory. @elral investigated and reports this in Discord:

Stepper, Segments and LCD lib allocates there required memory on runtime. So far so good. BUT after uploading a new config the memory must be freed (delete class), and this does not really work on the Arduinos (what I have read). Most worse in this aspect is the 7Segment lib, as this one uses a bigger array in some functions (which are not used for now in the firmware).

A fix was also explored and mentioned in Discord:

I used only the required functions from the 7Segment lib and implemented them directly into the MFSegment.cpp (I guess Sebastian is not very happy with this ๐Ÿ˜‰ ) so that they are used statically (for what I have understood). With these changes the promicro does not crash anymore after uploading a new config. Furthermore I could save some more RAM usage with this change and with the already prepared changes it seems that the promicro runs stable with all devices activated. The only thing I haven't tested (just defined in the config) are the shift registers.

We need to decide if this is the approach to take to resolve this issue, then implement for real.

Mega doesn't report back all configuration after reloading configuration

From Jamie:

on the mega firmware. It was working very well, but just to test I reloaded the mfmc file for the board. The upload to the board appears to go well, but after exiting the MF Modules window, I was having problems and going back to MF Modules now showed the board is missing about half the configuration. I repeated this three times with the same result.

Enable overriding components via platformio.ini

The #defines that determine what components are supported by each firmware are currently set in the board header files with
no way to modify them from the command line of the build. This makes it impossible to generate board variants without
modifying the header file.

Fix this by wrapping each #define with an #ifndef, so it provides the default but can be overridden at compile time.

Byte count incorrect in shift-out

The function that sends data out to the shift registers is off by one in the byte count.
The behavior does not cause apparent malfunctions becaus the excess byte is discarded.
Fixed by #79.

Reduce RAM usage by centralizing button debounce time

From elral:

All Buttons are read in a for loop. Every button stores it's own time when it is read the last time, but for all buttons this is the same time (for loop). To save some RAM usage (60bytes for the proMicro) the "debouncing" can be done in the central function (readButtons() ).

Smooth analog potentiometer readings

Copied from MobiFlight/MobiFlight-Connector#519

Is your feature request related to a problem? Please describe.
I have encountered some electrical noise coming from 7 segment display modules, which cause jitter problems in a potentiometer. Suggestions received have reduced the problem but not eliminated it. It would be good to have a way to smoothen potentiometer readings through software.

Describe the solution you'd like
Implement a 10 reading rolling average in the arduino firmware with a soft switch in MF Connector analog input configuration, that can be used to turn this feature on and off. When on, the analog pot reading sent from the board will be the rolling average of the last 10 readings. This will effectively smoothen the readings and eliminate jitter. This technique has been successfully used to smoothen the operation of a yoke with three analog pots connected to a pro micro.

Describe alternatives you've considered
I have tried to isolate the noise problem in hardware and jitter has been successfully reduced, but not eliminated.

Additional context
Potentiometers can present jitter due to various reasons. This will provide a solution in software to alleviate this problem.
I suggest that instead of calculating a real rolling average, which can take too much computational power, adding 10 readings and dividing by 10 in each read cycle, Start with an assumed average of zero and an array of ten readings (all zero). In each cycle: increment the reading counter index (0 to 9), add the current reading divided by 10 and substract the counter indexed reading divided by 10. Finally, store the current reading in the counter indexed position (replacing the value just substracted).
Any error at start disappears within 10 cycles.

MFLCDDisplay::display() allocates a fixed array of 21 chars. This fails with 40 char LCDs

The buffer overflow with 40 chars corrupts the class storage, which leads to unpredictable behaviour.

I've rebuilt the Firmware with a new MAX_COL set to 40, uploaded to the Arduino controlling a 40 x 2 display. Works fine now.

Ideally ::attach() would return bool or byte, with an explicit error code for "too many columns". Then
the GUI can take appropriate action.

Error when uploading config with 9.1.0.1 beta

Reported in the discord by user jaelee105. The attached configuration loaded without error in 9.1 but results in an upload error with the new firmware beta:

2021-11-16 ์˜คํ›„ 7:04:30(468): ExecutionManager.autoConnectTimer_Tick(): No Sim running
2021-11-16 ์˜คํ›„ 7:04:23(938): Error on Uploading.
2021-11-16 ์˜คํ›„ 7:04:21(932): Uploading config (Part): 1.53.L1:1.52.R1:1.51.L2:1.50.R2:1.49.L3:1.48.R3:1.47.L4:1.46.R4:1.45.L5:1.44.R5:1.43.L6:1.42.R6:
2021-11-16 ์˜คํ›„ 7:04:21(901): Reset config: 13

FMC1.zip

This is on a Mega ch340.

Remove EEPROMEx library

Nothing special is used in this library so get rid of it and just rely on basic Arduino EEPROM functions.

Remove CHANGELOG.md

It's not needed. Also update the pull request template to remove references to it.

Investigate including the released firmware builds in MobiFlight connector

From Sebastian on current steps:

for mobiflight application there is the release bat
there is a little helper program that can read the version from the assembly file and uses that for creating the release package
for including the firmware into mobiflight i used to copy the hex files manually over to the firmware folder, and also add the the files manually/explicitly to the project
and then i have to update the version information in the mobifligbht module info class

There's a GitHub API for requesting info on the latest release:

https://api.github.com/repos/{{owner}}/{{repo}}/releases/latest

Or a specific tag:

https://api.github.com/repos/{{owner}}/{{repo}}/releases/tags/{{tag}}

Remove usage of button and rotaryencoder libs

From the MobiFlight issue elral has good changes to include:

I moved the required functions from button and rotaryencoder libs to MFEncoder.cpp. Therefore these libs are no longer required and I do not expect changes in these libs anymore (at least which would be required for MF). Interesting side effect is that this has reduced the RAM usage by ~210byte and Flash by ~2,1kB!?? If you are interested I can provide the changes and an additional test would be good if especially the FAST detection works with all encoder types.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.