Home › Forums › Environmental Sensors › Yosemite library cant be found!
Tagged: Arduino ide, yosemitech
- This topic has 26 replies, 4 voices, and was last updated 2023-01-26 at 3:35 PM by neilh20.
-
AuthorPosts
-
-
2020-01-07 at 5:44 AM #13533
Hello! I downloaded envirodiy library for the arduino ide. The problem is that my arduino program finds it outdated and cant find the h files im trying to include. I would really appreciate if someone have experienced this problem before and can help me!
Thanks in advance, Jesper!
-
2020-01-07 at 7:08 AM #13534
Is this what you’re looking for: https://github.com/EnviroDIY/YosemitechModbus
Did you download all of the libraries in this “Libraries” repository (https://github.com/EnviroDIY/Libraries)? I know there’s a big, green, inviting “download” button on the GitHub page, but because of the way the libraries are in linked repositories, if you download them that way all you will get is a bunch of empty folders. You have to download from this link (https://github.com/EnviroDIY/Libraries/blob/master/libraries.zip?raw=true) and then follow the instructions here: https://github.com/EnviroDIY/Libraries#installing-libraries-in-the-arduinocc-ide and here: https://www.arduino.cc/en/Guide/Libraries#toc5.
-
2020-01-07 at 7:20 AM #13535
Thanks for your answer although i got all the correct libraries and can see the one im looking for. The arduino ide still dont recognize it sadly.
-
2020-01-07 at 10:31 AM #13537
In what way does it “not see it?”. You mean a program won’t compile? Or you cannot see the examples in the library drop downs? What does you library folder look like? Your program? Do you also have SensorModbusMaster installed and include that in your sketch? The Yosemitech library depends on it.
-
2020-01-08 at 6:24 AM #13546
I have them all installed but the examples says they are not compatible and when i type in the includes it says it cant find them
1sensors/YosemitechY504.h: No such file or directory -
2020-01-08 at 10:57 AM #13547
sensors/YosemitechY504.h
is part of the ModularSensors library, not part of the Yosemitech library.
You need to post more details of what exactly you’re trying to do and exactly what error messages you’re getting before I can help more.
-
2020-01-10 at 5:30 AM #13587
Yeah im sorry was really tired but its working now. Do you or someone know if there is a library for the nodemcu?
-
2020-01-10 at 10:17 AM #13588
ModularSensors does NOT work using an ESP8266 of any flavor, including NodeMCU, as the main processor.
The Yosemitech library might; I’ve never tried.
-
2020-01-11 at 9:11 AM #13599
I use softwareserial and ive heard that it work but dont really know. But i am continuing some code for a module. As i couldnt download his code i made it from scratch. Acording to how i connected it it seems like its connected to the nodemcu but actually i dont really know sadly
-
2020-01-13 at 8:08 AM #13600
Are you using Arduino core on your ESP8266 or are you using NodeMCU Lua? They are completely different firmwares; Arduino core uses cpp and has many libraries that parallel functionality to an AVR Arduino board like the Arduino Uno. NodeMCU uses Lua script.
I use softwareserial and ive heard that it work but dont really know.
There is a SoftwareSerial for the ESP’s Arduino core, but I have never attempted to use it. Both SensorModbusMaster and YosemitechModbus are completely independent of SoftwareSerial. They should work on an ESP8266 using Arduino core, but, again, I’ve never tried.
As i couldnt download his code i made it from scratch.
I have no clue what code you’re talking about.
Acording to how i connected it it seems like its connected to the nodemcu but actually i dont really know sadly
Well, does it communicate or not?
-
2020-01-14 at 7:09 AM #13607
Yeah i use the arduino ide on my nodemcu. Im testing the sensor with the yosemite displayvalues library.
The thing i meant with own code was that the one working on this project before didnt give me anything like source code or explenation how he did work everything out.
Its searching all the slaveids and cant find the sensor. I use pin D6 for rx and d5 for tx but it just says it cant find the sensor.
The sensor im using is either a y-500b/y-1002 or y-2002. Im not quite sure. Dont really know what to do at this point because i know how modbus works everything is wired correctly and it uses a levelconverter.
1234567891011121314yosemitechModel model = Y502; // The sensor model number// Define the sensor's modbus addressbyte modbusAddress = 0x01; // The sensor's modbus address, or SlaveID// Yosemitech ships sensors with a default ID of 0x01.// Define pin number variablesconst int PwrPin = D0; // The pin sending power to the sensor *AND* RS485 adapterconst int DEREPin = -1; // The pin controlling Recieve Enable and Driver Enable// on the RS485 adapter, if applicable (else, -1)// Setting HIGH enables the driver (arduino) to send text// Setting LOW enables the receiver (sensor) to send textconst int SSRxPin = D6; // Recieve pin for software serial (Rx on RS485 adapter)const int SSTxPin = D5; // Send pin for software serial (Tx on RS485 adapter) -
2020-01-14 at 8:37 AM #13608
Got information now that it is the y-500b does that even work with this library?
-
2020-01-14 at 12:22 PM #13611
I’m sorry, but you keep saying things that are unclear and incomplete which makes it very frustrating for me in trying to help you. I need you to share more information.
Do you have or have you read the manual from Yosemitch for your sensor and do you understand how it works? I am not specifically familiar with the Y500-B; I assume it can be interacted with like a Y502.
Have you ever succeeded in communicating with this sensor – that is, using your computer, a hand-held Yosemitech transmitter, an AVR based Arduino, or any other device that is NOT your Node MCU board?
Do you know your sensor’s modbus address? That information is required.
Now describe completely your physical wiring and connections:
- Are you using breadboards or have you made a custom circuit of some kind? Post a picture.
- By what is the Yosemitch sensor powered and at what voltage?
- Exactly what RS485 to TTL adapter do you have connected between the A and B (green and white) of your Y500B and your NodeMCU (brand, chipset, etc)
- What powers the RS485 adapter and at what voltage?
- Does the adapter require the use of a pin to change the direction of communication or does it have automatic flow control?
- Are there any LED’s on your adapter?
- If so, do you see the power, Tx, and Rx LED’s light up appropriately?
- What level shifters are you using (brand, etc)?
- Are your level shifters between the Tx and Rx of your adapter and the pins of your NodeMCU?
- If not, where are they in the chain?
- What voltages are you shifting to and from?
- I have not succeeded in using external level shifters on a breadboard with an RS485 adapter so I am quite skeptical of a set-up that requires them.
- Are you sure you have Tx and Rx coming out of the adapter connected appropriately the pins you are assigning as Rx and Tx in SoftwareSerial?
- Have you tried reversing the Tx and Rx?
In your code, what version of the Yosemitch library, of SensorModbusMaster, and of the Arduino core for ESP8266 do you have installed? Please list the versions and post your complete code.
-
2020-01-16 at 7:44 AM #13657
-
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277/*****************************************************************************GetValues.inoThis prints basic meta-data about a sensor to the first serial port and thenbegins taking measurements from the sensor.The sensor model and address can easily be modified to use this sketch with anyYosemitech modbus sensor.*****************************************************************************/// ---------------------------------------------------------------------------// Include the base required libraries// ---------------------------------------------------------------------------#include <Arduino.h>#include <SoftwareSerial.h>#include <Wire.h> // For the I2C for the OLED display#include <AMAdafruit_GFX.h> // For the OLED display#include <SDL_Arduino_SSD1306.h> // For the OLED display#include <YosemitechModbus.h>// ---------------------------------------------------------------------------// Set up the sensor specific information// ie, pin locations, addresses, calibrations and related settings// ---------------------------------------------------------------------------// Define the sensor typeyosemitechModel model = Y502; // The sensor model number// Define the sensor's modbus addressbyte modbusAddress = 0x01; // The sensor's modbus address, or SlaveID// Yosemitech ships sensors with a default ID of 0x01.// Define pin number variablesconst int PwrPin = D6; // The pin sending power to the sensor *AND* RS485 adapterconst int DEREPin = -1; // The pin controlling Recieve Enable and Driver Enable// on the RS485 adapter, if applicable (else, -1)// Setting HIGH enables the driver (arduino) to send text// Setting LOW enables the receiver (sensor) to send textconst int SSRxPin = D6 ; // Recieve pin for software serial (Rx on RS485 adapter)const int SSTxPin = D5; // Send pin for software serial (Tx on RS485 adapter)// Construct software serial object for ModbusSoftwareSerial modbusSerial(SSRxPin, SSTxPin);// Construct the Yosemitech modbus instanceyosemitech sensor;bool success;// Set up the OLED displaySDL_Arduino_SSD1306 display(-1); // using I2C and not bothering with a reset pin// ---------------------------------------------------------------------------// Main setup function// ---------------------------------------------------------------------------void setup(){pinMode(PwrPin, OUTPUT);digitalWrite(PwrPin, HIGH);if (DEREPin > 0) pinMode(DEREPin, OUTPUT);Serial.begin(57600); // Main serial port for debugging via USB Serial MonitormodbusSerial.begin(9600); // The modbus serial stream - Baud rate MUST be 9600.delay(2000);// Start up the sensorsensor.begin(model, modbusAddress, &modbusSerial, DEREPin);// Start the OLEDdisplay.begin(SSD1306_SWITCHCAPVCC, 0x3C, false);display.clearDisplay();display.setTextSize(1);display.setTextColor(WHITE);display.setCursor(0,0);// Turn on debuggingsensor.setDebugStream(&Serial);// Start up notedisplay.println("Yosemitech ");display.println(sensor.getModel());display.display();display.println(sensor.getParameter());display.println("Sensor");display.display();delay(3000);// Get the sensor's hardware and software versiondisplay.clearDisplay();display.setCursor(0,0);float hardwareV, softwareV;sensor.getVersion(hardwareV, softwareV);display.println("Hardware Version:");display.println(hardwareV);display.println("Software Version:");display.println(softwareV);// Get the sensor serial numberString SN = sensor.getSerialNumber();display.println("Serial Number:");display.print(SN);display.display();delay(3000);// Get the sensor calibration status (pH only)if (model == Y532){display.clearDisplay();display.setCursor(0,0);byte status = sensor.pHCalibrationStatus();display.println("Calibration Status:");display.print("0x0");display.println(status, HEX);display.display();delay(3000);}// Get the sensor's current calibration valuesif (model != Y532){display.clearDisplay();display.setCursor(0,0);float Kval = 0;float Bval = 0;sensor.getCalibration(Kval, Bval);display.println("Current Calibration Equation:");display.print(Kval);display.print("*raw + ");display.println(Bval);display.display();delay(3000);}if (model == Y511 || model == Y513 || model == Y514){display.clearDisplay();display.setCursor(0,0);// Check the wiper timinguint16_t interval = sensor.getBrushInterval();display.println("Sensor auto-cleaning interval: ");display.print(interval);display.println(" minutes");display.display();delay(3000);}// Tell the sensor to start taking measurementsdisplay.clearDisplay();display.setCursor(0,0);display.println("Starting sensor measurements");display.println();success = sensor.startMeasurement();if (success) display.println(" Measurements started.");else display.println(" Failed to start measuring!");display.display();// The modbus manuals recommend the following warm-up times between starting// measurements and requesting values :// 2 s for whipered chlorophyll// 20 s for turbidity// 10 s for conductivity// On wipered (self-cleaning) models, the brush immediately activates after// getting power and takes approximately 10-11 seconds to finish. No// readings should be taken during this time.// pH returns values after ~4.5 seconds// Conductivity returns values after about 2.4 seconds, but is not stable// until ~10 seconds.// DO does not return values until ~8 seconds// Turbidity takes ~22 seconds to get stable values.display.clearDisplay();display.setCursor(0,0);display.println("Allowing sensor to stabilize..");display.display();for (int i = 10; i > 0; i--){display.print(i);display.display();delay (250);display.print(".");display.display();delay (250);display.print(".");display.display();delay (250);display.print(".");display.display();delay (250);}display.display();if (model == Y511 || model == Y513 || model == Y514){display.clearDisplay();display.setCursor(0,0);// We'll run the brush once in the middle of thisdisplay.println("Activating brush.");display.display();success = sensor.activateBrush();if (success) display.println(" Brush activated.");else display.println(" Failed to activate brush!");display.display();}if (model == Y511 || model == Y513 || model == Y514 || model == Y510){display.clearDisplay();display.setCursor(0,0);display.println("Continuing to stabilize..");display.display();for (int i = 12; i > 0; i--){display.print(i);display.display();delay (250);display.print(".");display.display();delay (250);display.print(".");display.display();delay (250);display.print(".");display.display();delay (250);}display.println("\n");display.display();}}// ---------------------------------------------------------------------------// Main loop function// ---------------------------------------------------------------------------void loop(){display.clearDisplay();display.setCursor(0,0);display.setTextSize(2);// send the command to get the valuesfloat parmValue, tempValue, thirdValue = -9999;sensor.getValues(parmValue, tempValue, thirdValue);display.println("Temp (C):");display.print(" ");display.println(tempValue);display.print(sensor.getParameter());display.print("(");display.print(sensor.getUnits());display.print("): ");display.print(" ");display.println(parmValue);if (model == Y532 || model == Y504){display.println("thirdValue:");display.print(" ");display.println(thirdValue);}display.display();// Delay between readings// Modbus manuals recommend the following re-measure times:// 2 s for chlorophyll// 2 s for turbidity// 3 s for conductivity// 1 s for DO// The turbidity and DO sensors appear return new readings about every 1.6 seconds.// The pH sensor returns new readings about every 1.8 seconds.// The conductivity sensor only returns new readings about every 2.7 seconds.// The teperature sensors can take readings much more quickly. The same results// can be read many times from the registers between the new sensor readings.delay(1700);}
Are you using breadboards or have you made a custom circuit of some kind? Post a picture.
Yes i put it in.
- By what is the Yosemitch sensor powered and at what voltage?
Connected in a levelshifter from a arduino mini pro.
- Exactly what RS485 to TTL adapter do you have connected between the A and B (green and white) of your Y500B and your NodeMCU (brand, chipset, etc)
- What powers the RS485 adapter and at what voltage?
- Does the adapter require the use of a pin to change the direction of communication or does it have automatic flow control?
https://www.aliexpress.com/item/32647766464.html I dont think it got flowcontrol. Its powered by the vcc(3.3v) from the nodemcu.
- <li style=”list-style-type: none;”>
<li style=”list-style-type: none;”>- Are there any LED’s on your adapter?
- If so, do you see the power, Tx, and Rx LED’s light up appropriately?
Yes it glows bright red.
- What level shifters are you using (brand, etc)?
- Are your level shifters between the Tx and Rx of your adapter and the pins of your NodeMCU?
- If not, where are they in the chain?
- What voltages are you shifting to and from?
- I have not succeeded in using external level shifters on a breadboard with an RS485 adapter so I am quite skeptical of a set-up that requires them.
Its chinese and honestly i dont know as i said before i just continued someones old project and couldnt find the shifter on the internet.
- Are you sure you have Tx and Rx coming out of the adapter connected appropriately the pins you are assigning as Rx and Tx in SoftwareSerial?
- Have you tried reversing the Tx and Rx?
Everything correctly wired because it worked before i used it.
Attachments:
-
-
2020-01-16 at 3:05 PM #13673
It would help me to help you if you would be more verbose and detailed in your responses.
You didn’t answer whether you, yourself, had every succeeded in communicating with the sensor in any other way. I assume that means no.
You’re using example code that includes code for a small screen? Do you have one? If not, it might be easier to use the “GetValues” example instead of the “DisplayValues” one.
Up to now you had been telling me you were using a NodeMCU, now you’re mentioning an Arduino Mini. Your picture looks like you’ve cobbled the two together. Is the NodeMCU the main brain? What does the Arduino Mini do?
An Arduino mini can be either 5V or 3.3V. It should be labeled on the back of the Mini – check. The NodeMCU is always 3.3V. The Yosemitech requires a minimim of 5V power. Most level shifters are either labeled or have an in and out voltage based on what is connected on each side. Trace your wires so you know what voltages you have on both sides of the shifters. Please write it down so you and the next person the project gets dumped on will know.
The adapter you linked, which I’m guessing is the blue board on the top right of your picture, does NOT have automatic flow control. You must connect the DE and RE from your adapter to each other and the two of them together to some pin on your main control board. It looks like you have at least one of them connected to D0 (or D1?), but I can’t tell if you’ve tied them together or left one floating. If one is floating, rewire so they are tied together. You also need to change line 35 of your code to use the correct pin, as it says in the instructions in your code. The code you have now is not correct and would NOT work for your current setup.
Whether or not the setup you have worked for someone else before you, it’s apparently yours now, so trace wires and make notes until you understand all of the connections.
-
2020-01-17 at 4:41 AM #13678
It would help me to help you if you would be more verbose and detailed in your responses.
Yeah sorry about that will try to answer better. Im really appreciative about your help!
You didn’t answer whether you, yourself, had every succeeded in communicating with the sensor in any other way. I assume that means no.
Yes you are right. Ive never done a sucssesfull communication with the sensor. I just get no response.
You’re using example code that includes code for a small screen? Do you have one? If not, it might be easier to use the “GetValues” example instead of the “DisplayValues” one.
Yes i got a small screen to show me the values.
Up to now you had been telling me you were using a NodeMCU, now you’re mentioning an Arduino Mini. Your picture looks like you’ve cobbled the two together. Is the NodeMCU the main brain? What does the Arduino Mini do?
The arduino mini is just for mfrc and giving voltage to the sensor. Also ground.
An Arduino mini can be either 5V or 3.3V. It should be labeled on the back of the Mini – check. The NodeMCU is always 3.3V. The Yosemitech requires a minimim of 5V power. Most level shifters are either labeled or have an in and out voltage based on what is connected on each side. Trace your wires so you know what voltages you have on both sides of the shifters. Please write it down so you and the next person the project gets dumped on will know.
The adapter you linked, which I’m guessing is the blue board on the top right of your picture, does NOT have automatic flow control. You must connect the DE and RE from your adapter to each other and the two of them together to some pin on your main control board. It looks like you have at least one of them connected to D0 (or D1?), but I can’t tell if you’ve tied them together or left one floating. If one is floating, rewire so they are tied together. You also need to change line 35 of your code to use the correct pin, as it says in the instructions in your code. The code you have now is not correct and would NOT work for your current setup.
De and re is solder’d togheter and connected to D0. But if i try to use D0 in the dere in the code i just get error (28) and the screen wont load.
Whether or not the setup you have worked for someone else before you, it’s apparently yours now, so trace wires and make notes until you understand all of the connections.
I think i understand all the connections now. The picture i attached is one of the sensors that i took apart so see were everything sits.
-
2020-01-17 at 12:23 PM #13681
Ah ha! Can you check which version of SensorModbusMaster you have? Is it by chance 0.6.7 or lower? There’s was nasty bug that would cause non-avr boards to crash if the DE/RE pin was set and debugging was turned off. The bug was only caught and fixed by @neilh about a month ago. You can get the current version here: https://github.com/EnviroDIY/SensorModbusMaster
-
2020-01-18 at 7:28 AM #13691
Thank you very much! I got it to connect but reciving 1 bytes because of (CRC of response is not correct!)
Probably just me doing something wrong with delays!
-
2020-01-18 at 9:16 AM #13693
I just get 1byte but sometimes i get 2, the read too 0x03. So i dont really know whats wrong now lol.
-
2020-01-21 at 8:31 AM #13699
Do you have any idea what could be the issue? Thanks
-
2020-01-21 at 1:19 PM #13701
Are you using the same program you posted earlier? Can you post the output with debugging enabled?
C++1sensor.setDebugStream(&Serial);Are you getting seeing responses in the raw debugging that mostly complete but are being rejected due to incorrect CRC or is the whole response only one or two bytes. Please post your output.
Are you sure you have the correct modbus address? Have you tried the running the GetSlaveId program: https://github.com/EnviroDIY/YosemitechModbus/blob/master/utilities/GetSlaveID/GetSlaveID.ino?
-
2020-01-22 at 4:53 PM #13716
I found the issue with the help of a friend. It doesnt work with some board versions. Got it to work with esp8266 version 2.5. The only one ive tested that works but my friend told me that atleast 2 more works. Will update witch ones working!
-
2020-01-23 at 10:17 AM #13717
-
2023-01-25 at 10:44 AM #17555
Trouble Compiling
We have several installations of Mayfly .5 & Digi modems in the field running code we developed years ago on the Arduino IDE. This winter we want to convert our solution to run on our Mayfly 1.0 & SIM7080, so I started by downloading the DRWI_SIM7080LTE sketch + several libraries – and of course I can’t get it to compile. Question – where is a list (or better yet a repository) of all the libraries + version that will compile? PS: I’d like to keep using the Arduino IDE, and not have to move over to Platform I/O, if that’s possible.
-
2023-01-25 at 1:49 PM #17556
Hi Cal, its good if you could include the compile errors, even perhaps as an attachment. In your current form you are making anybody wanting to help do a lot more work.
As you are posting in this old thread on Yosemite-library I’m guessing its something to do with that.
I had a similar problem with Yosemitech Lib described here- https://github.com/EnviroDIY/YosemitechModbus/issues/32 I think its an AnthonyA issue with the Yosemitech Lib not being labeled.
If it is about Yosemitech Lib issue, you might trying pull from the (master) and I don’t think its an issue there, as it references an earlier Yosemitech Lib
-
2023-01-26 at 7:04 AM #17558
Thanks for the reply Neil. The only reason I picked this thread to post was it started with a title “library can’t be found”. That’s been one of my problems. Let me know if there is a better place to post.
I’ve fixed my problems – mostly downlevel code in my library.
-
2023-01-26 at 3:35 PM #17561
Hi Cal, great to hear you’ve got your problem solved.
Believe me that is part of the process, learning how the libs go together. They can be amazing to pull in, – but its part of the programming paradigm of how to reference and track them.
Sometimes better to post a new thread when asking a question, and for programming its getting the focus on the right level of detail to be able to get thoughts on what is causing an issue.
-
-
AuthorPosts
- You must be logged in to reply to this topic.