Oftewel het 'knutsel' forum.
Heb je zelf een weerstation gemaakt, een eigen weer hut gebouwd? Of misschien een webcam? Deel dan hier ervaringen, (bouw-)tekening etc...
Door wvdkuil
#71311
VERPLAATST uit de discussie over de raspberry versie.


T.J. schrijft in ander topic:
Mooi man.

Idd een beste bui geweest.

Ook dashboard is mooie aanvulling op de site.

Binnenkort ook maar eens aan de gang.

Ligt in de planning om eerst de basis beginselen van Arduino te leren, aan de hand van een handboek en diverse projecten die daarin staan.

Groeten Tjeerd

Vooral dat boek en de basis begrippen. Of toch maar een Raspberry versie, daar zijn uitgebreide beschrijvingen van op de SwitchDoc website. Maar niets van hulp bij de Arduino versie.

Er staat in de documentatie van Switchdoc
It works locally right out of the box with the software already installed on the Arduino Mini Pro LP included in the kit.
Maar helaas, niets werkt. En volgens de discussies op hun forum moet alles toch zelf geïnstalleerd worden. Inclusief trial-and-error met naamgeving e.d.

Ik was weer eens te optimistisch en dacht na de goede ervaringen met de Luftdaten arduino dat het wel dezelfde kwaliteit zou zijn. Dus dat ik na een uurtje knutselen kon uitzoeken hoe de data naar een website te krijgen.

Maar nu herb ik een hoop leuke electronica, geen onweer-detectie en moet ik eerst wat uitzoek-studie tijd vrijmaken.

Wellicht is er een Arduino knutselaar die weet hoe ik dit moet doen en waar de juiste Arduino software te vinden is? Dit zijn de stappen die volgens het forum gedaan moeten worden. Maar ook dan werkt het (nog) niet.

1. Downloaded Arduino software
2. Downloaded the SDL Arduino Folder from SDL's Github
3. Remove master from the name of the GitHub folder or it wouldn't load the project
4. Downloaded the Arduino Master? whatever that is from here.... github.com/ninjablocks/arduino
5. Unzipped the TimeLib and WifiEsp into the Arduino software created folder. (/Documents/Arduino/libraries)
6. Copied the I2C folder from step 4 into the same Arduino Library folder as step 5
7. Set the Arduino Software to:
A: Board: Arduino Pro or Pro Mini
B: Processor: ATmega328P (5v, 16MHz)
8: Upload to Arduino
Read more: http://forum.switchdoc.com/thread/447/t ... z5CXs6KREV

Wim
Door wvdkuil
#71312
Na wat uitzoeken en inlezen werkt de Arduino bijna helemaal.
Alleen zie ik geen mogelijkheid om de juiste tijd ergens toe te voegen.

Een raspberry heeft een RealTimeClock en kan de tijd van een "tijd"-server ophalen.

In de code van SwitchDoc kan ik daar niets van vinden.

===

Volgende stap is het ophalen van de gegevens die de arduino heeft opgeladen naar "PubNub" zodat die ook op de website geplaatst kunnen worden.

Wim
Door wvdkuil
#71314
Ondanks de hulp van twee andere HWA-leden kom ik er niet uit.

Normaal wordt de huidige tijd opgehaald van een "ntp server", er zijn ook voor Arduino voorbeelden hoe dat te doen. Maar ik zie geen mogelijkheid die voorbeelden aan te passen voor de SwitchDoc code.

Dus als er ergens een Arduino specialist is die het wil uitzoeken, de werkende set kan opgehaald worden. Of opgestuurd natuurlijk.

Ik begrijp dat de set als die "stand-alone" gebruikt wordt geen tijd nodig heeft. Dan kijk je op de display.

Maar de set zoals die door SwitchDoc verkocht wordt inclusief kastje is wel 150$. Zonder kastje altijd nog 80$.

Wim
Door wvdkuil
#71316
hvd51 schrijft:
Ik heb een ADXL bewegingssensor aan een arduino hangen ook daar liep ik tegen het tijdprobleem aan.
Doordat ik de geregistreerde bewegingen in een database stop kon ik de tijd halen van de webserver en die met de geregistreerde waardes opslaan.

Misschien een idee ?

Harm
https://www.weerstationtzandt.nl/review_dataADXL.php
Leuk idee, maar er is geen database kennis/ervaring bij de meeste gebruikers.

Ik dacht met deze Arduino bliksem-sensor een leuke uitbreiding te hebben voor een gemiddeld weerstation. Naast de weer-webcam ende luchtkwaliteit metingen, weer iets wat ons eigen station zou onderscheiden van WU en andere grotere spelers.

Deze arduino "computer" heeft maar zeer weinig vrije ruimte voor extra code.
Het toevoegen van de eigen webserver als een extra oplaad-lokatie zal vermoedelijk teveel ruimte kosten. Er is nu geen algemene code om iets op te laden, het is allemaal toegespitst op 1 speciale upload.

De data wordt nu opgeladen naar https://www.pubnub.com/ en de eenvoudigste oplossing 'lijkt" daar de data weer vandaan proberen te halen. Als dat lukt, geeft de server de exacte oplaad-tijd en in de opgeladen data staat de verlopen tijd sinds laatste opstart. Dus de correcte tijd van de laast gemeten "lightning" is dan te berekenen.

Veel "mitsen en maren", maar het is een hobby, toch?

Wim
Door WSParkstad
#71318
Zekers een mooie hobby en net dat wat Wim beschrijft, eigen data verzamelen is het mooiste wat er is en ja als ik een Radar mocht plaatsen hierzo dan zou ik ook een eigen Neerslag Radar hebben, maar die mag ik niet hebben, helaas.

Maar misschien een idee wat mij zo invalt wat betreft tijd, is er geen mogelijkheid om gebruik te maken van een GPS antennen en natuurijk de juiste drivers of software die dan de tijd uitleest van jet GPS gebeuren?

Misschien ene domme opmerking of idee want ja ik dnek ook als er een GPS op ken dan zou een beetje software wta betreft een NTP server toch ook moeten werken.

Groetjes,

Marcel.
Door Weerstation Heinenoord
#71326
Het zou inderdaad leuk zijn als met een Arduino een leuk "instapmodelletje" gebouwd kan worden. Met een uitlezing en een upload die hoe dan ook uiteindelijk op de eigen website gebruikt kan worden. Met vereende krachten moet er uit te komen zijn. Zelf ben ik geen programmeur, maar hier geldt ook: "beter goed geleend, dan slecht verzonnen". Bijgevoegd de Arduino "bijvangst" van m'n speurwerk naar raspberry varianten. Misschien zit er iets tussen over het binnenhalen van de juiste tijd.
Het zijn allemaal leuke leuke bijdragen, maar nog nergens een kant-en-klaar verhaal over hardware en ALLE software die nodig is om een kale Arduino met AS3935 chip op te tuigen.
Maar wellicht dat de lijst iemand kan uitnodigen eens in de Arduino te duiken en met Wim net zo'n leuk dingetje kan opzetten als voor het "Luftdaten" projekt

Mvg,

Peter
Door T.J.
#71333
Ik kan wel een bestand vinden dat ook in de directory van de arduino moet.
Het heet time.zip en wordt door arduino gebruikt om tijd te meten.
Op github staan meerdere programmatjes voor arduino en de AS9395.
Voor arduino en switchdoc lightning is er deze aanvulling.


De readme van dit tijd bestand:

# Arduino Time Library

Time is a library that provides timekeeping functionality for Arduino.

The code is derived from the Playground DateTime library but is updated
to provide an API that is more flexable and easier to use.

A primary goal was to enable date and time functionality that can be used with
a variety of external time sources with minimum differences required in sketch logic.

Example sketches illustrate how similar sketch code can be used with: a Real Time Clock,
internet NTP time service, GPS time data, and Serial time messages from a computer
for time synchronization.

## Functionality

The functions available in the library include

```c
hour(); // the hour now (0-23)
minute(); // the minute now (0-59)
second(); // the second now (0-59)
day(); // the day now (1-31)
weekday(); // day of the week (1-7), Sunday is day 1
month(); // the month now (1-12)
year(); // the full four digit year: (2009, 2010 etc)
```

there are also functions to return the hour in 12 hour format

```c
hourFormat12(); // the hour now in 12 hour format
isAM(); // returns true if time now is AM
isPM(); // returns true if time now is PM

now(); // returns the current time as seconds since Jan 1 1970
```

The time and date functions can take an optional parameter for the time. This prevents
errors if the time rolls over between elements. For example, if a new minute begins
between getting the minute and second, the values will be inconsistent. Using the
following functions eliminates this probglem

```c
time_t t = now(); // store the current time in time variable t
hour(t); // returns the hour for the given time t
minute(t); // returns the minute for the given time t
second(t); // returns the second for the given time t
day(t); // the day for the given time t
weekday(t); // day of the week for the given time t
month(t); // the month for the given time t
year(t); // the year for the given time t
```

Functions for managing the timer services are:

```c
setTime(t); // set the system time to the give time t
setTime(hr,min,sec,day,mnth,yr); // alternative to above, yr is 2 or 4 digit yr
// (2010 or 10 sets year to 2010)
adjustTime(adjustment); // adjust system time by adding the adjustment value
timeStatus(); // indicates if time has been set and recently synchronized
// returns one of the following enumerations:
timeNotSet // the time has never been set, the clock started at Jan 1 1970
timeNeedsSync // the time had been set but a sync attempt did not succeed
timeSet // the time is set and is synced
```

Time and Date values are not valid if the status is timeNotSet. Otherwise values can be used but
the returned time may have drifted if the status is timeNeedsSync.

```c
setSyncProvider(getTimeFunction); // set the external time provider
setSyncInterval(interval); // set the number of seconds between re-sync
```

There are many convenience macros in the `time.h` file for time constants and conversion
of time units.

To use the library, copy the download to the Library directory.

## Examples

The Time directory contains the Time library and some example sketches
illustrating how the library can be used with various time sources:

- `TimeSerial.pde` shows Arduino as a clock without external hardware.
It is synchronized by time messages sent over the serial port.
A companion Processing sketch will automatically provide these messages
if it is running and connected to the Arduino serial port.

- `TimeSerialDateStrings.pde` adds day and month name strings to the sketch above
Short (3 character) and long strings are available to print the days of
the week and names of the months.

- `TimeRTC` uses a DS1307 real time clock to provide time synchronization.
A basic RTC library named DS1307RTC is included in the download.
To run this sketch the DS1307RTC library must be installed.

- `TimeRTCSet` is similar to the above and adds the ability to set the Real Time Clock

- `TimeRTCLog` demonstrates how to calculate the difference between times.
It is a vary simple logger application that monitors events on digtial pins
and prints (to the serial port) the time of an event and the time period since
the previous event.

- `TimeNTP` uses the Arduino Ethernet shield to access time using the internet NTP time service.
The NTP protocol uses UDP and the UdpBytewise library is required, see:
http://bitbucket.org/bjoern/arduino_osc ... /Ethernet/

- `TimeGPS` gets time from a GPS
This requires the TinyGPS library from Mikal Hart:
http://arduiniana.org/libraries/TinyGPS

## Differences

Differences between this code and the playground DateTime library
although the Time library is based on the DateTime codebase, the API has changed.
Changes in the Time library API:

- time elements are functions returning `int` (they are variables in DateTime)
- Years start from 1970
- days of the week and months start from 1 (they start from 0 in DateTime)
- DateStrings do not require a seperate library
- time elements can be accessed non-atomically (in DateTime they are always atomic)
- function added to automatically sync time with extrnal source
- `localTime` and `maketime` parameters changed, `localTime` renamed to `breakTime`

## Technical notes:

Internal system time is based on the standard Unix `time_t`.
The value is the number of seconds since Jan 1 1970.
System time begins at zero when the sketch starts.

The internal time can be automatically synchronized at regular intervals to an external time source.
This is enabled by calling the `setSyncProvider(provider)` function - the provider argument is
the address of a function that returns the current time as a `time_t`.
See the sketches in the examples directory for usage.

The default interval for re-syncing the time is 5 minutes but can be changed by calling the
`setSyncInterval(interval)` method to set the number of seconds between re-sync attempts.

The Time library defines a structure for holding time elements that is a compact version of the C tm structure.
All the members of the Arduino tm structure are bytes and the year is offset from 1970.
Convenience macros provide conversion to and from the Arduino format.

Low level functions to convert between system time and individual time elements are provided:

```c
breakTime(time, &tm); // break time_t into elements stored in tm struct
makeTime(&tm); // return time_t from elements stored in tm struct
```

The DS1307RTC library included in the download provides an example of how a time provider
can use the low level functions to interface with the Time library.

Dus ook ntp server functionaliteit.

Op github staan alle bestanden, het einge is de juiste implementatie van deze.
Ook de wifi bestanden voor een esp8266 wifiboard staan erbij.

https://github.com/switchdoclabs/SDL_Ar ... rBoard_IOT

Groeten Tjeerd