Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Yosemite library cant be found!

Home Forums Environmental Sensors Yosemite library cant be found!

Viewing 26 reply threads
  • Author
    Posts
    • #13533
      Deppi
      Participant

        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!

      • #13534
        Sara Damiano
        Moderator

          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.

        • #13535
          Deppi
          Participant

            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.

          • #13537
            Sara Damiano
            Moderator

              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.

            • #13546
              Deppi
              Participant

                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

              • #13547
                Sara Damiano
                Moderator

                  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.

                • #13587
                  Deppi
                  Participant

                    Yeah im sorry was really tired but its working now. Do you or someone know if there is a library for the nodemcu?

                  • #13588
                    Sara Damiano
                    Moderator

                      ModularSensors does NOT work using an ESP8266 of any flavor, including NodeMCU, as the main processor.

                      The Yosemitech library might; I’ve never tried.

                    • #13599
                      Deppi
                      Participant

                        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

                      • #13600
                        Sara Damiano
                        Moderator

                          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?

                        • #13607
                          Deppi
                          Participant

                            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.

                          • #13608
                            Deppi
                            Participant

                              Got information now that it is the y-500b does that even work with this library?

                            • #13611
                              Sara Damiano
                              Moderator

                                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.

                              • #13657
                                Deppi
                                Participant
                                  •  

                                    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:
                                • #13673
                                  Sara Damiano
                                  Moderator

                                    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.

                                  • #13678
                                    Deppi
                                    Participant

                                      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.

                                    • #13681
                                      Sara Damiano
                                      Moderator

                                        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

                                      • #13691
                                        Deppi
                                        Participant

                                          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!

                                        • #13693
                                          Deppi
                                          Participant

                                            I just get 1byte but sometimes i get 2, the read too 0x03. So i dont really know whats wrong now lol.

                                          • #13699
                                            Deppi
                                            Participant

                                              Do you have any idea what could be the issue? Thanks

                                            • #13701
                                              Sara Damiano
                                              Moderator

                                                Are you using the same program you posted earlier?  Can you post the output with debugging enabled?

                                                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?

                                              • #13716
                                                Deppi
                                                Participant

                                                  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!

                                                • #13717
                                                  Sara Damiano
                                                  Moderator
                                                  • #17555
                                                    Cal
                                                    Participant

                                                      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.

                                                    • #17556
                                                      neilh20
                                                      Participant

                                                        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

                                                      • #17558
                                                        Cal
                                                        Participant

                                                          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.

                                                        • #17561
                                                          neilh20
                                                          Participant

                                                            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.

                                                        Viewing 26 reply threads
                                                        • You must be logged in to reply to this topic.