Forums > Windsurfing   Gps and Speed talk

Another DIY GPS logger approach

Reply
Created by rp6conrad > 9 months ago, 2 May 2021
Flex2
WA, 366 posts
30 Sep 2022 8:41PM
Thumbs Up

In the early days of Jan's software where it wrote each data packet straight to the file you needed a reasonable quality SD card. After Jan added the write buffer seems you can use pretty much any SD card... My last units used the attached 16GB 65MB/s which were the cheapest I could find at $10AUD for 3 (Officeworks I think). 16G holds around 4000hrs of sail data so no need to go larger. Elmo must have gone real budget shopping it seems if you are having issues with the card.


elmo
WA, 8868 posts
30 Sep 2022 9:17PM
Thumbs Up

They were genuine sandisk cards the same model as previous just 32Gb as I couldn't get the 16's

decrepit
WA, 12765 posts
1 Oct 2022 12:56PM
Thumbs Up

I'm going to try one in my old DIY logger. I bet they work in that, with an openlogger chip.
Re formatting with SDformatter didn't help. And as Alby says they weren't budget, genuine SanDisk @ $13 a pop.

decrepit
WA, 12765 posts
1 Oct 2022 8:50PM
Thumbs Up

Yep, my theory's correct, the old SD card from my early DIY logger works in the new one, and Alby's new cards work in the old logger.
The old SD card is a SanDisk Ultra, the new cards are SanDis Ultra Plus.
Go figure?
So I now have 2 working units, but without wifi connecting, slowly getting there.

So what is it about the new logger and SanDisk Ultra Plus cards?????? They don't want to work together!!

boardsurfr
WA, 2454 posts
1 Oct 2022 9:48PM
Thumbs Up

Select to expand quote
decrepit said..
Yep, my theory's correct, the old SD card from my early DIY logger works in the new one, and Alby's new cards work in the old logger.
The old SD card is a SanDisk Ultra, the new cards are SanDis Ultra Plus.
Go figure?
So I now have 2 working units, but without wifi connecting, slowly getting there.

So what is it about the new logger and SanDisk Ultra Plus cards?????? They don't want to work together!!


That's pointing to an explanation. The SanDisk Ultra Plus cards are MicroSDXC cards - note the "XC" at the end. The SDXC cards use the exFAT file system (needed to support files larger than 4 GB, which can easily happen with videos). The 32 GB SanDisk Ultra that I tried in the logger and which worked just fine uses the FAT32 format.

So it seems that the firmware for the logger does not support exFAT formated disks - any SD cards that are "SDXC". Theoretically, that could probably be addressed in the firmware, but would require finding the right libraries and changing the code.

Practically, the easiest solution would be to re-format the card to use FAT32. That seems straightforward on the Mac with Diskutility, but should be doable on Linux, too.

decrepit
WA, 12765 posts
1 Oct 2022 10:23PM
Thumbs Up

Select to expand quote
boardsurfr said..>>>Practically, the easiest solution would be to re-format the card to use FAT32. That seems straightforward on the Mac with Diskutility, but should be doable on Linux, too.


I've reformatted with SDformatter and GParted, without fixing it. I've one option left which is the basic disks utility, but it doesn't let you choose the format. I'll give that a go tomorrow

boardsurfr
WA, 2454 posts
1 Oct 2022 11:27PM
Thumbs Up

SDFormatter just erases the disk, but does not change the file system type, so that won't help. I'm not familiar with GParted.

I have verified with 2 different microSD cards that the exFAT file system is indeed the problem. One card was a Sandisk Ultra 32 GB, the other a Samsung Evo Select 64 GB. Both cards are NOT recognized by the ESP32 logger if the filesystem is exFAT, but work without any problems if the filesystem is FAT32.

I changed the file system using Disk Utility on macOS 10.14. I have also tried to do this on Windows10. Some changes worked fine there, but others seemed to take forever, and the support for FAT32 is "hidden", so the Mac was a lot easier. Note that the Mac creates a few "hidden" directories on the cards. They don't hurt (just make directory listings longer), and can be deleted from Windows or Linux.

I had one funny little problem while playing around with cards. The first card I picked was an ancient card that looked like a microSD card, with a big "32". But it always came out formated as "FAT12" on the Mac, which does not work in the logger. On Windows, trying to format it as FAT32 failed with an error message "File system too small". Took me quite a while to take a closer look and discover that this is a 32 MB card, not a 32 GB card .

decrepit
WA, 12765 posts
2 Oct 2022 8:52AM
Thumbs Up

Thanks Peter,
The "disks" program didn't work either, I've put the question on the Mint forum, If I can't get it to work we'll have to ask Fangy to do the lot.

decrepit
WA, 12765 posts
2 Oct 2022 9:10AM
Thumbs Up

So fdisk says it W95 FAT32 (LBA), no mention of exfat????????

decrepit@Percy:~$ sudo fdisk -l
[sudo] password for decrepit:
<<<<<< removed so you don't need to read the unnecessary
Disk /dev/sdg: 29.73 GiB, 31927042048 bytes, 62357504 sectors
Disk model: USB3.0 CRW-SD/MS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdg1 8192 62357503 62349312 29.7G c W95 FAT32 (LBA)

decrepit@Percy:~$

boardsurfr
WA, 2454 posts
2 Oct 2022 9:38AM
Thumbs Up

Sounds like the disk is not formatted and partitioned properly. The FAT32(LBA) is not a partition, but rather a container for partitions. You may find this link useful:
unix.stackexchange.com/questions/156225/cannot-mount-w95-fat32-lba-partition-type-in-archlinux

For your disk, the command should be:
sudo mkfs.vfat /dev/sdg1 -F 32

boardsurfr
WA, 2454 posts
2 Oct 2022 10:00AM
Thumbs Up

It's been years since I last used a Linux machine, so my knowledge about file systems and partitions is very rusty. If you know someone who has a Mac that you could use to format the disks, using Disk Utility on the Mac would be the easiest way to get these disks readable.

But since you're probably trying it on your Linux box, here's a quote from another relevant web page:
"Beware, when you choose a partition type in cfdisk (or fdisk), it
doesn't format anything.
It just fill a record with an ID, wich is meant to indicate what type of
formatting will be on it."

This seems to confirm what the other post I linked to in the previous email said.

decrepit
WA, 12765 posts
2 Oct 2022 1:09PM
Thumbs Up

Well tried all sorts of stuff, got rid of the (LBA) thing, but still not working.
So I have a feeling they'll be going to Fangys, to see what he can do.

I did however get WiFi working, The SSID is actually WiFi-5D86F0, Id left WiFi off thinking that was descriptive, not part of the actual name.
Now I have one out in the open doing a static test.

shannon19
QLD, 104 posts
2 Oct 2022 4:07PM
Thumbs Up

I have found gparted worked pretty well for formatting and partitions on Linux. I will have a look tomorrow when I get home.

decrepit
WA, 12765 posts
2 Oct 2022 5:48PM
Thumbs Up

More problems!!!!! The first data is terrible only 5 sats, and lots of big errors.
Noticed earlier on here, Flex's problem with GPS antenna being too close to the wifi. I had them temporarily, all held together in a pack with an elastic band. So pulled the antenna out of the pack and had another go.
No data at all now, out of any of the units. Still reading the SD cards OK, but no writes.
Why does my head feel like it's been bashing against a wall?????

Flex2
WA, 366 posts
2 Oct 2022 6:00PM
Thumbs Up

Decrepit, are you getting a blue flashing light on GPS as that is comms (10Hz if that's your logging speed)? Are you able to get serial monitor running with Arduino? That really helps with troubleshooting. What's the screen displaying? Maybe Tx and Rx swapped?

rp6conrad
364 posts
2 Oct 2022 6:22PM
Thumbs Up

The normal behaviour of the logger if you switch it on :
1. Try to read the SD card, startup-screen is SD OK or (this is bad) SD NOK !
2. Try to read the config.txt file if SD OK : startup-screen says (briefly) Config OK
3. Try to set the GPS configuration over serial connection, if the sample rate is 5 Hz, the blue LED on the gps should now flash @ 5 Hz
4. Try to connect to Wifi for 10 seconds, AP-mode is active. If you activate now the reed switch, AP mode will last for 100 s.
5. If Wifi is found, Wifi screen comes up with IP adress. (Wifi ON). This screen will stay as long you have connection with Wifi !
If no Wifi is found : waiting for a gps fix.
6. Logging is only starting when a gps fix AND a minimal speed is detected AND no Wifi connection !

If you have the serial monitor connected, a lot of info is coming over the serial monitor.

decrepit
WA, 12765 posts
2 Oct 2022 9:36PM
Thumbs Up

Select to expand quote
Flex2 said..
Decrepit, are you getting a blue flashing light on GPS as that is comms (10Hz if that's your logging speed)? Are you able to get serial monitor running with Arduino? That really helps with troubleshooting. What's the screen displaying? Maybe Tx and Rx swapped?


Yep, blue flashing light at 10hz, red flashing led aprox 1 hz
Haven't tried arduino serial monitor. I'm sure Rx, Tx are fine otherwise I wouldn't have got the first lot of data.

decrepit
WA, 12765 posts
2 Oct 2022 9:57PM
Thumbs Up

Select to expand quote
rp6conrad said..
The normal behaviour of the logger if you switch it on :
1. Try to read the SD card, startup-screen is SD OK or (this is bad) SD NOK !


Yes, SD card OK.
Select to expand quote

2. Try to read the config.txt file if SD OK : startup-screen says (briefly) Config OK

yes, that's good.
Select to expand quote

3. Try to set the GPS configuration over serial connection, if the sample rate is 5 Hz, the blue LED on the gps should now flash @ 5 Hz

yes goes to 10hz
Select to expand quote

4. Try to connect to Wifi for 10 seconds, AP-mode is active. If you activate now the reed switch, AP mode will last for 100 s.

don't have magnet yet.
Select to expand quote

5. If Wifi is found, Wifi screen comes up with IP adress. (Wifi ON). This screen will stay as long you have connection with Wifi !
If no Wifi is found : waiting for a gps fix.

6. Logging is only starting when a gps fix AND a minimal speed is detected AND no Wifi connection !

woops! I thought we could do geostationary tests, so it was just sitting out in the back yard. I'll take it for a ride tomorrow, and should see some results
Select to expand quote
If you have the serial monitor connected, a lot of info is coming over the serial monitor.


Thanks Heaps Jan, sorry to be such a silly old fart and not read the manual!
Just went for a brief jog out in the dark, and have got a result that looks encouraging. I'll do better tomorrow, and take them for a proper spin

boardsurfr
WA, 2454 posts
2 Oct 2022 10:45PM
Thumbs Up

Mike, for doing stationary tests, it's easy to not connect to your WiFi network at all. Instead, just use the logger in AP mode (which is a direct connection between your computer and the logger). That works well even for general use. For file downloads, the FTP connection always goes to the same IP address (192.168.4.1), regardless of unit. Firmware updates also work fine. The advantage is that the wifi gets switched off about 20 seconds after the logger is switched on, unless you connect to the AP point from the computer.

To use the logger in AP mode only, do the following:
1. In the config.txt file, chance the network description to a non-existing network (for example:
"ssid": "none",
"password": "no password",
2. To connect to the logger:
- switch the logger on
- when you see the "Connecting to .." screen, use the magnet (or, before putting the logger in the case, the right bottom on the board) to enter AP mode (you have 10 seconds to do that)
- the logger switches to a screen that shows the Wifi AP info (ssid is "ESP32AP", below it shows the password)
- on your computer, select ESP32AP as the WiFi network, and log in using the password shown on the screen
- when your computer is connected, the logger screen will show the IP address of the logger.

For FTP file transfers:
- connect to the logger AP point as above
- enter the IP address shown (192.168.4.1) in the FTP program and log in as usual
- if you want to download from multiple units in a row:
- quit the FTP program
- switch off the first logger, switch on the second logger
- follow the steps to connect above (you will probably have to select the ESP32AP wifi network again).

To update firmware using AP mode, type the IP address in your browser (192.168.4.1) and log in using the same credentials that you usually use for firmware updates.

boardsurfr
WA, 2454 posts
2 Oct 2022 10:53PM
Thumbs Up

Select to expand quote
decrepit said..

rp6conrad said..
6. Logging is only starting when a gps fix AND a minimal speed is detected AND no Wifi connection !


woops! I thought we could do geostationary tests, so it was just sitting out in the back yard.


You can do geostationary tests if you disable the automatic wifi logins (as described above for AP mode access). To get over the minimum speed to start logging, you may have to move the GPS around a bit after is has a satellite fix (walk quickly, or spin around in a circle holding the GPS out, for a few seconds). Sometimes, logging will start automatically when the initial data exceed the speed limits, but that's a matter of luck, and less likely to happen with a hot start.

Imax1
QLD, 4925 posts
3 Oct 2022 6:54AM
Thumbs Up

I know what the problem is , your not speaking English. I've read the whole last page and didn't understand one word you guys are saying .

decrepit
WA, 12765 posts
3 Oct 2022 3:40PM
Thumbs Up

Took the Ultra Plus cards to Fangy, no luck with his disk utility. Card started off as fat32, ended as fat32 after formatting. Still wouldn't work. But I did a swap with him 2 SanDisk 32gb ultra plus cards for 2 Strontium Nitro 16 gb cards. Now we have 4 working units.
If anybody else has class 10 SD cards they'd like to swap for SanDisk ultra plus cards, that would be helpful.

Unless of course somebody can get these things working.

shannon19
QLD, 104 posts
3 Oct 2022 8:42PM
Thumbs Up

Did anyone manage to figure out how to solve the problem of the board not booting after it's shut down? I re flashed mine tonight and I could switch it on and off at the time but after a while it would not switch back on.

boardsurfr
WA, 2454 posts
3 Oct 2022 8:30PM
Thumbs Up

Select to expand quote
shannon19 said..
Did anyone manage to figure out how to solve the problem of the board not booting after it's shut down? I re flashed mine tonight and I could switch it on and off at the time but after a while it would not switch back on.


That's probably a bad board. If you hook it up to a serial monitor, you'd likely see a checksum violation in the safe boot. Can't do that with an epoxied unit, though. There are plenty of reports of ESP boards blocking up after various times - sometimes very quickly, sometimes after working fine for months.

boardsurfr
WA, 2454 posts
3 Oct 2022 9:08PM
Thumbs Up

Select to expand quote
decrepit said..
Took the Ultra Plus cards to Fangy, no luck with his disk utility. Card started off as fat32, ended as fat32 after formatting. Still wouldn't work. But I did a swap with him 2 SanDisk 32gb ultra plus cards for 2 Strontium Nitro 16 gb cards. Now we have 4 working units.
If anybody else has class 10 SD cards they'd like to swap for SanDisk ultra plus cards, that would be helpful.

Unless of course somebody can get these things working.


The few references I have seen for the Ultra Plus 32 GB seem to indicated that this is not an "XC" type card, only the 64 GB and larger ones are. But it also seems that SanDisk stopped selling the Ultra Plus line, while the older Ultra line (without the plus) is still available. Seems quite possible that there is something wrong with the Ultra Plus cards that cannot be fixed using reformatting and partitioning tools.

Windxtasy
WA, 4017 posts
3 Oct 2022 9:29PM
Thumbs Up

aren't these DIY GPS units a whole lot of fun?
So glad I am past that stage.
It is worth it in the end

decrepit
WA, 12765 posts
3 Oct 2022 10:04PM
Thumbs Up

Yes Anita, I realised that when I took my two for a test drive today. I didn't know the display was that good, it's huge in comparison to anything else, so easy to read. Even had me doing 360s at roundabouts to test the alpha readout, (managed a 24) with 4m separation.

rp6conrad
364 posts
3 Oct 2022 10:59PM
Thumbs Up

Select to expand quote
decrepit said..
Took the Ultra Plus cards to Fangy, no luck with his disk utility. Card started off as fat32, ended as fat32 after formatting. Still wouldn't work. But I did a swap with him 2 SanDisk 32gb ultra plus cards for 2 Strontium Nitro 16 gb cards. Now we have 4 working units.
If anybody else has class 10 SD cards they'd like to swap for SanDisk ultra plus cards, that would be helpful.

Unless of course somebody can get these things working.


I am afraid that this cannot be solved with reformatting the sd-card. It seems that the Arduino libs only works with sd-cards with a max of 32GB ! Sd-cards with more then 32GB are SDXC-cards, and behave different on the SPI interface. When you google "Arduino SD card max size", this is the answer :



The max size is 32GB. This is the limit for all types of SD cards on Arduino. Arduino only supports SD (2GB and less), and SDHC (more than 2GB and up to 32 GB). Cards larger than 32GB are SDXC and are not supported by arduino libraries.4 jun. 2012






decrepit
WA, 12765 posts
4 Oct 2022 9:53AM
Thumbs Up

Select to expand quote
rp6conrad said.. I am afraid that this cannot be solved with reformatting the sd-card. It seems that the Arduino libs only works with sd-cards with a max of 32GB ! Sd-cards with more then 32GB are SDXC-cards, and behave different on the SPI interface. When you google "Arduino SD card max size", this is the answer :
The max size is 32GB. This is the limit for all types of SD cards on Arduino. Arduino only supports SD (2GB and less), and SDHC (more than 2GB and up to 32 GB). Cards larger than 32GB are SDXC and are not supported by arduino libraries.4 jun. 2012



It's not just the size!
SanDisc Ultra Plus cards probably don't work in any size. the ones I have here are 32GB.

The take home from my experience here is,

DO NOT USE Ultra Plus cards.

plain old Ultra cards are OK,

You may get away with bigger cards by reformatting to fat32 instead of exfat.

boardsurfr
WA, 2454 posts
4 Oct 2022 10:06AM
Thumbs Up

Select to expand quote
rp6conrad said..


I am afraid that this cannot be solved with reformatting the sd-card. It seems that the Arduino libs only works with sd-cards with a max of 32GB ! Sd-cards with more then 32GB are SDXC-cards, and behave different on the SPI interface. When you google "Arduino SD card max size", this is the answer :
The max size is 32GB. This is the limit for all types of SD cards on Arduino. Arduino only supports SD (2GB and less), and SDHC (more than 2GB and up to 32 GB). Cards larger than 32GB are SDXC and are not supported by arduino libraries.4 jun. 2012



Don't believe everything that you find with Google. Perhaps that statement was correct 10 years ago, but it is not correct anymore.

As I write this, my ESP logger is happily recording onto a 64 GB micro SD card (Samsung Evo). There is no inherent "hard" limit on the size of the SD cards used (other than general limits of the file system, which are probably a lot larger).




And yes, the logger produced the expected files on the 64 GB card.

A search for "Arduino SD card max size" using Ecosia (Bing) gives a more informative and correct answer at forum.arduino.cc/t/sd-card-storage-max-size/344346:
"SdFat allows larger SDXC cards to be formatted FAT32"
and
"The card must be FAT32."
It then points out that
"The Official SD Association Formatter an Windows utilities will not format cards larger than 32GB as FAT32."

The last two answers point to some of the problems one may encounter when trying to use cards larger than 32 GB: you have to reformat the card as FAT32, but that's not always straightforward. In Windows10, for example, you can format an SD card from the popup (right-click) menu, but you will not see "FAT32" as an option. You can still format the card as FAT32, but you'll have to use the command line (or perhaps a third-party tool.. but not the SD Formatter).

For the 64 GB card in the pictures above, I used Disk Utility on MacOS 10.14 to change the format from exFAT (which the card came with, but did not work) to FAT32 (which works).



Subscribe
Reply

Forums > Windsurfing   Gps and Speed talk


"Another DIY GPS logger approach" started by rp6conrad