Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/t3logger #119

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Feature/t3logger #119

wants to merge 23 commits into from

Conversation

Martenz
Copy link
Contributor

@Martenz Martenz commented Jan 22, 2023

Moved TTGO T3 v2.1.1.6 board PIN configuration on its own case selected in forced mode through specific flag set only for platformio [env:ttgo-lora32-v1_SD_CARD]

SD logging working with latest 5.3.0 master version now, it work only for this T3 board.

Logging web page moved to code, still not completed yet, download and delete functions to be implemented.

Branch tested also with TBEAM with EINK with [env:PsRam] working as before with previous master 5.3.0

Asking to merge to compare and test also with other boards. Soon I will improve the web page for downloading and managing igc track logs while keeping updated my branch with latest GxAir development.

Martino.

src/Logger.h Outdated
// Manufacturer of the pressure sensor in the logger. Any text.
#define IGC_ROW13 "HFPRSPRESSALTSENSOR:BOSH,BMP280,max10000m"
// Manufacturer of the GPS receiver inside the logger. Do we really care? Any text will work
#define IGC_ROW14 "HFGPS:uBLOX Neo6"
#define IGC_ROW14 "HFGPSBeitian BN220"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ":" after HFGPS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, added in latest push to feature/T3logger branch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important, but would be nice to have these fields configurable via the web ui. Not everyone uses a Beitian BN220, e.g., I have a uBlox in my proto.

src/main.cpp Outdated
Comment on lines 2121 to 2122
PinBaroSDA = 3; //13;
PinBaroSCL = 4; //14;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it works only the other way round. This seems to be a (quality) issue with the board, there are some reports on this in the web. Do you mind changing it here? Otherwise I might open a PR so that it can be changed in the web UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry you mean it works with commented values? not sure I got it right. I'm getting a new board tomorrow, and can test other configurations. let me know thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it works to have

Suggested change
PinBaroSDA = 3; //13;
PinBaroSCL = 4; //14;
PinBaroSDA = 4;
PinBaroSCL = 3;

Of course with the wiring accordingly. It seems that due to quality issues some pins cannot switch within the specifications for I2C. This combination is more robust.

@@ -5034,11 +5057,19 @@ void taskLogger(void * pvPArameters){
SD_MMC.begin("/sdcard", true);
}

logger.begin();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on line 5051,5052,5055,5056:
Should be 14, not 4?! (See data sheet for SPI pin connection to SD Card on the board.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my board it works like that.. I found that data sheets and pin layout images sometimes not so correct with these boards, anyhow I will try next days to check also this. thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested with pin 14 I can not mount the sd it gives:

E (2713) sdmmc_sd: sdmmc_check_scr: send_scr returned 0xffffffff
[E][SD_MMC.cpp:79] begin(): Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true.

while with pin 4 it works properly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is strange. According to the datasheet:
SD3-CS-IO13
CMD-MOSI-IO15
CLK-SCK-IO14
SD0-MISO-IO2

And that is correct for me (and should be for most?!)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, pin 4 is used for I2C of the baro so it should not interfere with the sd card.
What I realized is that when configuring the sda and scl pins for the baro, only scl is set to input_pullup.
Both sda and scl should have a pullup resistor (ideally external one, but internal is good enough with my board).

As a result, I configure both to "input_pullup"

    PinBaroSDA = 4;
    PinBaroSCL = 3;
    pinMode(PinBaroSCL, INPUT_PULLUP);
    pinMode(PinBaroSDA, INPUT_PULLUP);

Can you add this to your code and check with 14 instead of 4 again?

I was already considering to open a PR with a change that allows for setting the pins via the web UI. That could resolve the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I can test it tomorrow. I should receive the new board today, the usb of the old one is almost dead.
I will try your setup and update accordingly if it works.
thanks for your time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works with your configuration, so will use this as well. Later I will test on my old board changing soldered pin just to double check, but I guess switch sclerosis sda and changing 4 to 14 together did the job. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants