Coder Social home page Coder Social logo

Comments (7)

shred avatar shred commented on September 23, 2024

The only reason for 0 Hz after calibration is a problem with the interrupt.

  • Make sure the IRQ out of the AS3935 is connected to the correct port of your ESP. It is supposed to be the GPIO5 pin. On my ESP board this pin is labeled "D1", but it can be different on your board. You can also use any other free port, but you need to adapt the AS_INT constant at the top of kaminari.ino accordingly.
  • If you have a scope, make sure there is a signal on the IRQ line during calibration.
  • If you don't use an ESP8266 board, maybe your board is not able to handle interrupts at all, or cannot handle interrupts on the GPIO5 pin.

What ESP board are you using?

from kaminari.

HaViGit avatar HaViGit commented on September 23, 2024

Thanks for your fast respond! The board I use is a Wemos D1 Mini (not the pro), these are my definitions in the sketch:

#define SPI_CS 15 // IO15 (D8)
#define SPI_MOSI 13 // IO13 (D7)
#define SPI_MISO 12 // IO12 (D6)
#define SPI_SCK 14 // IO14 (D5)
#define AS_INT 5 // IO5 (D1)
#define NEOPIXEL 4 // IO4 (D2)

Can you tell me how to connect the AS3935 sensor when using above definitions and the Wemos board? As you know, these are the pins:

Vcc → 3.3 V
GND → GND
SCL →
MOSI →
MISO →
CS →
SI →
IRQ →
EN_V →
A0 →
A1 →

from kaminari.

shred avatar shred commented on September 23, 2024

The Wemos D1 Mini seems to be the same type as the board I am using. The correct wiring is:

Vcc → 3.3 V
GND → GND
SCL → D5
MOSI → D7
MISO → D6
CS → D8
SI → GND
IRQ → D1
EN_V → GND
A0 → GND
A1 → GND

Be careful with the wiring for MISO and MOSI. The correct wire order on the ESP side is D5-D7-D6-D8, not D5-D6-D7-D8. I had them mixed up on my first wiring attempt.

Thinking about your problem again, it's also possible that the ESP cannot talk to your AS3935 at all. Anyway, my bet is on a wiring issue.

from kaminari.

HaViGit avatar HaViGit commented on September 23, 2024

After re-wiring as described and double checking, the calibrated antenna frequency is still reported as 0 Hz. During calibration my scope shows a signal on the IRQ line (D1). Although I am using a Wemos D1 mini like you did, do you think this board (sometimes) cannot talk to the AS3935 board?

Also not sure if this AS3935 board is a good choice, there are many issues reported on the internet, especially about calibration. So I now consider to order the SEN0290 sensor from DFRobot.

from kaminari.

shred avatar shred commented on September 23, 2024

I have added a few diagnostics logs in commit 49baecd. It should tell you whether the AS board is not visible, or if the IRQ signal is just missing.

"No AS3935 was detected. Please check your wiring!" -> ESP cannot talk to the AS3935. (Bad SPI wiring?)
"No interrupt detected during calibration. Please check your wiring!" -> ESP does not receive interrupts. (Bad IRQ wiring?)

You are right, calibrating the AS3935 is difficult. However, the Kaminari firmware should do most of the calibration work for you.

from kaminari.

HaViGit avatar HaViGit commented on September 23, 2024

To be sure it was not the Wemos D1 Mini I have replaced it with another one, a Pro version. Running your latest sketch this it the serial monitor output:

Calibrating antenna...
No interrupt detected during calibration. Please check your wiring!
Warning: calibrated frequency is out of tolerance range.
Calibrated antenna frequency: 0 Hz
Server is listening on port 80

Wiring is okay, board should not be the problem so only the AS3935 sensor seems to cause the issue. Especially since the sensor can only be tested during a thunderstorm, I must be sure that it is reliable. I think this sensor board is not and I have lost confidence, partly because of the many issues on the internet. I am going to order the sensor from DFRobot so I have to be patient.

Anyway thanks for helping Richard!

from kaminari.

shred avatar shred commented on September 23, 2024

I'm sorry that I couldn't help you, but I'm out of clues. You said there is a signal on the IRQ line, but still the Wemos does not receive any interrupts. Maybe the Wemos ESP firmware is just different to the firmware on my ESP?

But if you need a reliable solution, this might be the wrong project for you anyway. It is just meant for experimental purposes.

I'm closing this issue. Feel free to reopen it if you found something.

from kaminari.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.