Jump to content

wimvb

Members
  • Posts

    8,947
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by wimvb

  1. The lastminuteengineers site uses inline svg icons. https://lastminuteengineers.com/bme280-esp32-weather-station/ (Further down the page) I created the missing icons with Inkscape. (More software to learn 😋) But images as in ordinary web pages also work.
  2. Otherwise, try the code from your link (lastminuteengineers) as given, ie without the conversion to DateTime.
  3. Just put the esp in the stevenson screen, no extra enclosure needed. Any extra enclosure will add some shielding which may affect the wifi signal strength. Electronics generally warms up enough not to dew up. Otoh, dew on the screen or rain may very well limit the wifi range. And make sure the antenna can 'see' the wifi source. As for i2c distance, I've used 0.3 - 0.4 m cat cable between a bme280, mlx ir sensor and an esp, and it worked fine. But I did connect an extra capacitor between + and - of the power leads.
  4. You should be able to use your wifi router for that. The esp has rtc functionality that can use the time from the wifi router. Btw, rather than saving data in varables, as you wrote earlier, consider saving it in a file on the esp. The weather station web server can access this file. If it contains a time stamp plus weather data, it's easy to determine the validity of the data. The file doesn't need to be updated every 2 seconds. Perhaps only every 30 seconds. Keeping data in a file rather than variables, seems more robust to me. Have a look here https://github.com/wberlo/indi_meteostation/blob/master/main.py The program measures weather parameters every minute and stores the data in the index.html file. Whenever a request comes in from a web client, the server responds with the html file. What's more, the INDI weather watcher can access and interprete this information as well. For a web client, this "page" can be made to look fancier with the help of css. Just a thought.
  5. I have a Meanwell 5 v power supply for my sbc's and a usb hub at the foot of my pier, but am actually considering binning that and have one buck converter on the scope. Fewer and shorter cables that way. Btw, it's not just cable resistance, but also contact resistance you have to consider. One more reason I have to bin the 5v supply is cable stiffness. I replaced all my plastic insulated power cables with teflon insulated. These are a bit heavier, especially the thicker ones. So there's more risk for cable drag. The 5v and 12 v cables go up the pier & scope, where I have a 12v and 5v power distribution box. I could put a buck converter in the 5v box and have one less cable to worry about.
  6. I don't know if an esp can, but an avr microcontroller, such as an arduino, certainly can. Input pins of such a chip are configured as 8 bit registers, called Ports, and you will normally read one such register/ port (= 8 bit) at a time. The solution that comes to mind is to use an attiny84 or similar. Connect the vane to 8 of its input pins, and program it as an i2c slave device. Edit: Since esp pins are configurable, the internal layout is very different from avr controllers. To read multiple gpio pins at the same time, you have to create your own register. Similar to this (but inputs in stead of outputs) https://stackoverflow.com/questions/52348930/esp32-direct-port-manipulation
  7. Right so, but it's wind gusts that will cause problems when the obsy is open. Even if the station won't control the obsy, it's nice to know what's happening outside. Along with the average of 5 minutes, also measure the maximum for those 5 minutes.
  8. Where that tree used to be, seems the best location. Otoh, as I said before, you're probably not going to do any scientific research with it, so near the wind instruments or even the asc, would be ok too. Meteorological meassurements have to be consistent, and comparable with each other. For those, stations need to be located in similar environments. But for you, it doesn't matter as much. Just make sure that obvious heat an circulation disturbing sources are avoided.
  9. Unless you want to do science with it, I think the exact location isn't critical. With the type you have, on a pole would seem the obvious place. If it were a box type enclosure made of wood, I would place it on a wall in an exposed location, so it would get good air circulation. From which direction does the wind blow? Even though you don't measure wind speed and direction from it, make it exposed enough, and not too sheltered. Near a south wall is of course definitely a no go. Btw, I found why at least my weather station becomes unresponsive after a while. The socket methods that I use, are blocking. I added timeout routines and got it working. I will put the fix in my weather station thread. https://stargazerslounge.com/topic/338749-yaaws-yet-another-arduino-weather-station/?do=findComment&comment=3918727
  10. Here's an update. First of all, I replaced the Arduino Uno with an ESP32 wifi mcu. I have also been playing with several versions of firmware for the station. Atm, I have a fancy web page, and no connection to INDI. But it's very easy to change the firmware. The web server works ok, but after a while the station stops responding. I found out that the web socket methods that are used (microPython), are blocking. This means that if a method doesn't respond, the whole web page / station locks. Now I've added timeouts and very basic error handling to the station, and this seems to solve the problem. If the web page on the client side doesn't get updated, you just have to hit the reload button in your web client. Here's the section of code that does the trick. It's part of the main.py file. The time out is set to a generous 10 seconds, and I've also added garbage collection (memory recovery) ---------------------------------------------------- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10.0) s.bind(('', 80)) s.listen(5) while True: gc.collect() conn, addr = s.accept() print('Got a connection from %s' % str(addr)) try: request = conn.recv(1024) response = web_page() conn.send('HTTP/1.1 200 OK\n') conn.send('Content-Type: text/html\n') conn.send('Connection: close\n\n') conn.sendall(response) except OSError as e: print('threw an exception') conn.close() finally: conn.close() time.sleep(4)
  11. Have a look here as well, even if it's just for future reference https://rntlab.com/question/solved-esp32-web-server-drops-connection-crashes/
  12. Probably the same issue I have, the connections aren’t closed properly. I read about a fix somewhere. I’ll see if I can find it.
  13. Nothing really. I wanted to learn python. An added bonus was that I skip pressing that button on the esp every time I want to upload a new program version.
  14. They are quite handy to have around. I think I have about six of them now: SQM meter, mini weather station, ordinary weather station (still fighting to get the RS485 interface working), and a few more for testing stuff. But I rarely use them with the Arduino IDE. I use the Thonny micropython editor most of the time. https://thonny.org/
  15. I haven't got my telescope control computer (Rock64 sbc) hooked up at the moment, so I don't have access to the Ekos profile. The INDI driver that I tested the weather station with is the Weather Watcher. This driver can access a file on the weather station controller (ESP32 in my case), or it can access a web server. https://indilib.org/weather/weather-watcher.html I intended to use the indiduino driver/setup for this project, but it seems that it is no longer maintained, and the information is quite sketchy. The Weather Watcher driver turned out to be a better option. The latest I have tested it with and got to work in Ekos, is to have the ESP32 create a html file that the driver can read. This can be done over wifi. You just give the INDI driver the IP address of the file. I have more info here: https://www.indilib.org/forum/general/6099-wifi-weather-station-with-esp32.html https://www.indilib.org/forum/ekos/6382-weather-watcher-question.html Hope this helps.
  16. Yesterday I found a "bug" in this solution. When I use Chrome as web client to access the weather info, it stops working after a while. Using IE, the esp keeps working. Most likely Chrome doesn't close connections properly, while IE does. This can lead to instability, and possible memory leaks. So it's not the web server itself that is to blame, but it should be programmed to deal with Google's inability to produce quality products. I've started looking into possible solutions, but need to do more research.
  17. Yes, press the boot/reset button when upload starts. Once the IDE connects to the board release the button
  18. +1 I played with mqtt with a rpi (2b?) as broker and esp32 as client. But I was testing it for use with INDI and simultaneous use as standalone server. And just to learn more about mqtt. I believe the mqtt and INDI part was the most difficult one. There is/was no mqtt INDI driver, so you’d need to build one. But MQTT and INDI are quite alike in structure.
  19. This is what my mini weather station produces atm (indoors) By replacing the main.py file on the ESP32, I can go from this to a single, plain text line output in a minute. And I can confirm that the ESP web server can handle multiple connections. I have it open in Chrome and in IE (same computer). Logging the data and graphing it would take more power than the ESP32 can handle.
  20. As in driving servos or stepper motors?
  21. Btw, did you know that esp32 devkit boards come in two flavours? Either with 30 pins, or with 36 pins. But the extra pins on the larger board are already used up by the internal flash. So no use buying the 36 pin version.
  22. Esp32 can create web pages in one of two ways, either on the go, whenever the server is accessed, or by creating a file called index.html or default.html. You should probably use the second option. https://randomnerdtutorials.com/esp32-web-server-arduino-ide/ https://randomnerdtutorials.com/esp32-web-server-spiffs-spi-flash-file-system/ Btw, lots of information on the randomnerdstutorials site
  23. It uses the wifi hardware but doesn't connect to a network. In stead it creates a peer to peer connection, similar to bluetooth, but also many-to-many. You should also check the esp32 youtube videos by Andreas Spiess (the "Swiss guy with the funny accent")
  24. The esp can use micropython, but even if weewx is ported to that, I think that you’ll run into memory problems. Even though the esp has 4MB, I believe. Installing a microsd card shield seems overkill. With multiple esp’s, you should definitely look into Esp-now. https://www.espressif.com/en/products/software/esp-now/overview
  25. Doesn't have to be ekos. Before I coded it so that indi drivers could poll the data, I coded it as an ordinary web server, like this https://lastminuteengineers.com/bme280-esp32-weather-station/
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.