Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:09 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : using OpenLog with the micromite

     Page 3 of 3    
Author Message
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 03:50am 29 Mar 2019
Copy link to clipboard 
Print this post

Hi Grogs, thanks for that. I'll have a good read.

Cheers (its nearly that time for you at least . . .),

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:16am 29 Mar 2019
Copy link to clipboard 
Print this post

You can get the source code
https://github.com/sparkfun/OpenLog

If I read it correctly, the file is opened as soon as the openlog starts so there is no option to set the time first.

In theory, you should be able to add a command to set the time on the openlog, but my Arduino knowledge is not up to the task and I don't know how much spare memory there is to play with.

Jim

VK7JH
MMedit
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 04:31am 29 Mar 2019
Copy link to clipboard 
Print this post

alas, there is little up-to-date documentation for OpenLog, with most of what is written about earlier versions. below is what i've divined from a cursory reading of the version 4.2 source code:

==========================
OpenLog 4.2 command syntax
==========================

----------------------------------------------------------------
init

no arguments, re-initializes SD card system
----------------------------------------------------------------
? and help

no arguments
----------------------------------------------------------------
baud

no arguments. queries for new baudrate
----------------------------------------------------------------
set

interactive menu to set up various things
----------------------------------------------------------------
ls [mask]

list current directory. sub-dirs have '\' afterwards
----------------------------------------------------------------
md <name>

create directory
----------------------------------------------------------------
rm

//NOTE on using "rm <option>/<file> <subfolder>"
// "rm -rf <subfolder>" removes the <subfolder> and all
// contents recursively
// "rm <subfolder>" removes the <subfolder> only if its empty
// "rm <filename>" removes the <filename>
----------------------------------------------------------------
cd <name>

change directory. ".." jumps to the root
----------------------------------------------------------------
read <filename> [location [, length]] [1|2|3]


----------------------------------------------------------------
write <filename> [location]


----------------------------------------------------------------
size <filename>

----------------------------------------------------------------
disk

print out SD card information
----------------------------------------------------------------
sync (does nothing)
----------------------------------------------------------------
reset

resets AVR
----------------------------------------------------------------
new <filename>

----------------------------------------------------------------
append <filename>

----------------------------------------------------------------
pwd (does nothing)
----------------------------------------------------------------
echo [on|off]
verbose [on|off]
eem [on|off]


someone needs to go through this, and check then document the exact behaviour of each command. i may get round to this at some time.

i'm also thinking of writing a variation of the OpenLog firmware, perhaps called OpenCMD. this would be much closer in use to a cut-down version of the msdos/windows command interpreter, along with a few extra commands to allow reading and writing ascii files. it would NOT have the automatic logging option at startup. this is what i have roughed out so far as a possible command set:

possible command set for OpenCMD
================================

exists "filename"
delete "filename"

open "filename" [ascii | hex8 | hex16 | hex32 | hex64]

size ["filename"] ; returns file size (default: size of opened file)
; if file does not exist, returns -1
seek <offset> ; set current location in opened file, -1 for EOF

append ; appends to end of existing file.
record ; records at current location (default=0)
replay ; returns next line, send <cr> for subsequent lines)
; returns ctrl-z for end of file
(send ctrl-z to exit any of the above three commands)

close

dir "mask" ; returns first line in directory listing
; send <cr> for subsequent lines, ctrl-z to exit
; returns blank line if no more files found
cd "directory"
md "directory"
rd "directory"

baud <baudrate>


is it worth the effort of creating such a replacement?


cheers,
rob :-)Edited by robert.rozee 2019-03-30
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 04:52am 29 Mar 2019
Copy link to clipboard 
Print this post

  Andrew_G said   Hi Grogs, thanks for that. I'll have a good read.

Cheers (its nearly that time for you at least . . .),

Andrew


Yes, 5:51pm now, so close enough to beer-o'clock.
Drinkin' some home-brew these last few nights.
Rather harsh to the palate, but much much easier on the wallet!
Smoke makes things work. When the smoke gets out, it stops!
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 05:31am 29 Mar 2019
Copy link to clipboard 
Print this post

Rob,
with your proposed OpenCMD would I be able to delay opening a file until I'd established the date and time, open it with a name of choice, write to it, close it etc. - if so I'd vote yes!

How would a Luddite like me program the new firmware? I have a PicKit3 (and 2) with a board with pogo pins?

Thinking ahead; could one "add" to the memory of the MM by loading code from the SD and then swapping it out again?
How about images or is the 170 too slow?

Cheers,
Andrew

Grogs - 16:31 here, Guinness for me
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 07:01am 29 Mar 2019
Copy link to clipboard 
Print this post

If you power-up the openlog with a sd card in the socket it will create a config.txt file if it doesn't exist already. The config file is only two lines of text and can be edited easily.

If there is a config.txt on the SD card the openlog will read that and set its
configuration accordingly.

So I set the option so that it starts in command mode, and i/o at 115200.
Once it is in command mode you can feed it commands directly, via
serial i/o eg manually with teraterm etc or from an external micro.
As you say, the commands are already available for practically all of the suggested list, eg for creating a file as ascii or binary etc.


Grogsters link above leads to a page with a command set link which has the info.

I have had a play, using the same i/o pins as the MM uses I think, and it seems pretty straightforward. 115200 is still not very fast but pretty useful.

In the SD library, the file date/time can be set up by putting a C++ line in with some variables and recompiling, but I don't know if that has been set up for the openlog which uses a modified library called SDfat.


Edited by chronic 2019-03-30
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 11:59am 29 Mar 2019
Copy link to clipboard 
Print this post

the SD library bundled with the arduino IDE is based upon SDfat, not the other way round. it is hard to say what the exact differences between the two are, but i get the vague impression that SDfat is more up-to-date.

OpenLog has two modes of operation.
1. an 'automatic' mode, where upon starting up all data received by the UART is written to a file on the SD card,
2. an interactive 'command' mode, where a named file can be written to, modified, and read back. directories can be created, navigated to, and deleted.

out of the box, OpenLog is in the automatic mode. connect to a terminal, press ctrl-Z three times in quick succession, and you will drop to the command mode. you can then type ? <cr> to get further information. type set <cr> to change configuration, followed by 3 <cr> to switch OpenLog to start up in command mode.

the OpenLog command mode can do most things, but is quite clunky to use - my feeling is that it evolved haphazardly as new requirements were made by users. developing something like OpenCMD from the ground up would give a result that is a little easier to make sense of, without the idiosyncrasies that Openlog suffers from.

regarding timestamping files: provided the SDfat library supports it, this should be relatively easy. the simplest solution would be a new command:
TIMESTAMP <date><time>
that sets the time and date of the currently open file. this could be added to OpenLog, or incorporated into OpenCMD (if/when someone writes it!)

regarding loading/saving basic programs to OpenLog, this would require a couple of small changes to the micrtomite firmware:
LIST [comport]
and
AUTOSAVE [comport, "preamble"]


cheers,
rob :-)



 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 01:38pm 29 Mar 2019
Copy link to clipboard 
Print this post


  Quote  the SD library bundled with the arduino IDE is based upon SDfat, not the other way round. it is hard to say what the exact differences between the two are, but i get the vague impression that SDfat is more up-to-date.


Sorry I should be clearer.
The standard arduino libraries for SD access are all based on SDfat .
The usual library relevant that was included is "SD.h".
To create OpenLog,the serial i/o buffer sizes were changed for better performance.
The modified library was then called "SDfat" and that was required for recompiling.
It has probably changed since then as well

In the original arduino SD utility, some variables and C++ could be used to preset file date, time etc and the file creation routine would use them when it created a file. [I don't know if OpenLog can do that or not.]

like this

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 01:35am 02 Apr 2019
Copy link to clipboard 
Print this post

The purple ones I linked to HERE have arrived, and they are programmed with the firmware.




Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 03:11am 02 Apr 2019
Copy link to clipboard 
Print this post

excellent news, that makes life a whole lot easier!

my usbasp board arrive, and i've got it up and running, and have used it to flash a new bootloader onto an arduino uno board, so it should be ok for any OpenLogs that arrive blank. the usbasp requires a libusbK driver - i used the zadig driver installer for this (zadig_xp-2.2.exe), but i believe the necessary drivers are also included in the usbasp firmware package from here:
https://www.fischl.de/usbasp/


cheers,
rob :-)Edited by robert.rozee 2019-04-03
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 04:21am 02 Apr 2019
Copy link to clipboard 
Print this post

I suppose I should be clear - the one I tried is programmed. They might not ALL be. I did buy four at that price, I will check the other three and see if they respond.

Nice easy way to check, is to power them up with no SD card and no serial connection - just 5v and ground. If the firmware is in the board, the SMD LED on the top right(with SD card on the bottom) will repeatedly blink three times because it cannot initialise the SD card(cos it can't find it!). But this is a quick easy way to see if the firmware is actually loaded into each unit.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:34pm 02 Apr 2019
Copy link to clipboard 
Print this post

I have checked all four of the purple ones I got, and they all have the firmware in them. If you are wanting to buy some, these would seem to be good ones to choose, as they would appear to be programmed, whereas the other ones are blank.
Smoke makes things work. When the smoke gets out, it stops!
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 375
Posted: 07:09am 21 May 2019
Copy link to clipboard 
Print this post

I ordered from the same supplier as Grogster. Mine was also ready to use (it has firmware OpenLog v4.1).
Tested with PuTTY and it seems to behave as described in the earlier posts. I used a 1GB SD card. Not yet tested with Micromite. Do anybody have some simple MM program examples where OpenLog is used?
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:54pm 21 May 2019
Copy link to clipboard 
Print this post

OpenLog is a cute little thing, and incredibly easy to use.
Out of the box, it is setup to automatically create logs and save anything you throw at it at 9600 baud.

Connect the OpenLog to one of the MM serial ports, and you can log things as simply as using the PRINT command. For example, if you put the OpenLog on COM1 and the port has been opened at 9600 baud, you just PRINT #1,"Hello world." - simple as that. The OpenLog will buffer the data and write it to the file on the SD card for you, all you have to to is send the data out the COM port.

When you first power up the system, the OpenLog will create and open a new file on the SD card and save all data to that file. When you cycle the power, another new file will be created, so it is pretty effortless to work with.
Smoke makes things work. When the smoke gets out, it stops!
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 01:08pm 06 Jun 2019
Copy link to clipboard 
Print this post

Hi Grogster,

I have just received some of those purple devices you had linked. Just wanted to know if you had any issues with any of them at all? I have fired up just one of them so far and it is working BUT it does not seems to be communicating properly. I have only tried a few commands so far but I did get it to list files a couple of time but now None and I cannot get it to show the help at all. I have tried three terminals (TT, cool term and also GFXTerm) but all with same result unfortunately. I will try again tomorrow. I was using a 5 volt battery supply to the unit and my normal usb/serial adaptor. Just checking for any tips/quirks you may have uncovered.

Mike
Codenquilts
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 01:19am 07 Jun 2019
Copy link to clipboard 
Print this post

OK I have replace the first one I tried and everything works fine , so it looks like I was unlucky and picked a dud for the first one to try. Not sure if its hardware or firmware corruption, probably the latter so seeing it partially works I will assume the boot-loader works OK and try re flashing it when eventually.

Cheers Mike
Codenquilts
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 12:22am 09 Jun 2019
Copy link to clipboard 
Print this post

Acknowledged.
Sorry I did not reply before - last week was busy and I could not spend as much time on the forums as I normally do....
Smoke makes things work. When the smoke gets out, it stops!
 
     Page 3 of 3    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025