Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 18:33 25 Apr 2024 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 : SD card not found.

Author Message
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 04:54am 12 Feb 2020
Copy link to clipboard 
Print this post

And I know it's because it's not inserted.....

Is there a simple one line test I can add to check for this state & jump over the logging routine?

Thanks

Phil.

Edit:- have tried,

  Quote  if Mm.Errno=1 then Exit sub

Edited 2020-02-12 14:58 by Phil23
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5900
Posted: 05:02am 12 Feb 2020
Copy link to clipboard 
Print this post

Depending on the device you are using ON ERROR SKIP should be what you need.
Use it just before you open the file and skip over the save routing if there is an error.

Jim
VK7JH
MMedit   MMBasic Help
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 05:04am 12 Feb 2020
Copy link to clipboard 
Print this post

Hmmm,

Maybe I should just RTFM a bit better.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 05:09am 12 Feb 2020
Copy link to clipboard 
Print this post

Option error continue fixed it.

On page 52 of my 5.4 manual.

  Quote  Set the treatment for errors in file input/output on the SD card. The option
CONTINUE will cause MMBasic to ignore file related errors. The program
must check the variable MM.ERRNO to determine if and what error has
occurred.
The option ABORT sets the normal behaviour (ie, stop the program and print
an error message). The default is ABORT.
Note that this entry only relates to errors reading from or writing to the SD
card. See the ON ERROR command in the Micromite User Manual for
handling syntax and other program errors.


Thanks for the Quick reply & also see you are looking on the CMX forum again.

Curious, what is your Davis VP Clone?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5900
Posted: 05:53am 12 Feb 2020
Copy link to clipboard 
Print this post

  Phil23 said  

Curious, what is your Davis VP Clone?


A micromite.
My Fine-offset system died again so I used the wind and rain sensors and built the rest.
The Davis protocol is well described so I went with that.
Hard wired because I hate batteries.

I am in the process of adding my SDS011 to the mix.
I can use the extra-sensors fields to get the data from the micromite into Cumulus (running on a RPi) and from there, I run a Windows program that interrogates a modified realtime.txt file.
I intended to have history saved on the micromite to cover reboots but that is something still on the gunna-do list.

Jim
VK7JH
MMedit   MMBasic Help
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 10:52am 12 Feb 2020
Copy link to clipboard 
Print this post

  TassyJim said  
I intended to have history saved on the micromite to cover reboots but that is something still on the gunna-do list.

Jim


Use a Winbond Flash memory - so easy to work with and up to 16MB for around $1... should be plenty(?) You need the SPI and a free pin for the Chip Select
Edited 2020-02-12 20:55 by CaptainBoing
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 04:07pm 12 Feb 2020
Copy link to clipboard 
Print this post

  Phil23 said  And I know it's because it's not inserted.....

Is there a simple one line test I can add to check for this state & jump over the logging routine?

Thanks

Phil.

Edit:- have tried,

  Quote  if Mm.Errno=1 then Exit sub


I give you an exemple of my prog who use "sprites functions"
in this sub, I test first if two files exist, and after if prox can use sprite function


'--- test if files exist
dim flgsprit as integer
dim flgsdcard as integer
dim numtyp as integer

flgsprit=0
flgsdcard=0
numtyp=0
if MM.INFO$(SDCARD)="Ready" then flgsdcard=1
if MM.device$="Pi-cromite" and instr(MM.INFO$(LCDPANEL),"HDMI")=0 then numtyp=9   'if pi and lcd on SPI no sprites and no texte transparent

ON error ignore  'this also raz errno
txt1$=dir$("image4c.bmp",file)  'files "Image4c.*"
ON error ABORT
if mm.errno=0 then
flgsprit=1
end if
ON error ignore
txt1$=dir$("logom4.png",file)  'files "Image4c.*"
ON error ABORT
if mm.errno=0 then
flgsprit=flgsprit+1
end if  
if flgsprit<2 then
if (flgsprit<=0 and flgsdcard=0) then print "*** SdCard for Sprite function is not present ***":txt="No files for Sprites"
if flgsprit=1 then print "*** 1 File missing for Sprite function ***":txt="1 file need for Sprites"
print "*** Function Sprite NOT aviable ***"
else
if numtyp=9 then
print "- Function SPRITE not aviable on Rpi with SPI LCD "
txt="Sprites NO"
else
print "- Function SPRITE aviable "
txt="Sprites OK"
end if
end if

 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 08:24pm 12 Feb 2020
Copy link to clipboard 
Print this post

  TassyJim said  
The Davis protocol is well described so I went with that.

I am in the process of adding my SDS011 to the mix.
I can use the extra-sensors fields to get the data from the micromite into Cumulus.


The idea of getting extra sensors via a micromite has always been in my mind, but I consider it way beyond my capabilities.

In my case the first thing I'd need would be a compatible transmitter module; which are out there, but I next get lost in the region/frequency specs.

Presume if I did get the right radio unit it would need to broadcast as Station 2.

You now have me wondering how out of reach it is..... with a little assistance.


Phil.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5900
Posted: 09:28pm 12 Feb 2020
Copy link to clipboard 
Print this post

  CaptainBoing said  
  TassyJim said  
I intended to have history saved on the micromite to cover reboots but that is something still on the gunna-do list.

Jim


Use a Winbond Flash memory - so easy to work with and up to 16MB for around $1... should be plenty(?) You need the SPI and a free pin for the Chip Select


I am using EERAM. The saving to backup is done.
When Cumulus starts up, it requests the backup data. It's that part I haven't finished yet. Considering that I restart the RPi once a year, it is not a high priority.

Phil,
I am not using a separate setup for the extra sensors. The Davis protocol has space allocated for 7 extra temperature sensors in the original data packet. One byte each.
I am going to use 4 of them for my PM2.5 and PM10 data.

I had thought about pretending it was solar data so I could use the builtin graphs but decided to save that for when I do add true solar sensors.

Jim
VK7JH
MMedit   MMBasic Help
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 05:11am 13 Feb 2020
Copy link to clipboard 
Print this post

Hi Jim,

What I had in mind was more about building my own sensor suite or ISS Transmitter with a Micromite for the extra sensors & put a few more temps & the AirQual monitor on there.

Not 100% sure how it would all work out, but in theory it might be doable.

My original VP2+ with all it's stuff on station 1 & the Micromite broadcasting as station 2.

Have you seen this thread?

VP2 Relay Device

It contains a lot of good data, much of which I haven't really digested.


Cheers

Phil.

Edit:-
  TassyJim said  
I had thought about pretending it was solar data so I could use the builtin graphs but decided to save that for when I do add true solar sensors.
Jim


It's probably not too hard to add the extra graphs in separate in the JS file that uploads to the web.

I've played a bit in there with little Java knowledge & I think It would just need a bit of cut & paste of the original Temp block & then a change to a few of the HighCharts settings in that block to make it look like the solar graph.

Did have a bit of a laugh on the weekend, discovered the Water NSW has updeated their charts with a new look.

They have started using HighCharts, which Cumulus has had for years.
Edited 2020-02-13 15:27 by Phil23
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 12:22pm 14 Feb 2020
Copy link to clipboard 
Print this post

  goc30 said  
if MM.INFO$(SDCARD)="Ready" then


Thanks goc30 for that snippet.

I was also having fun detecting cards than I remembered this thread & re-read it.

Brian
ChopperP
 
Print this page


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

© JAQ Software 2024