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

neilh20

Forum Replies Created

Viewing 10 posts - 291 through 300 (of 371 total)
  • Author
    Posts
  • in reply to: RS485 without auto direction control #13531
    neilh20
    Participant

      Hi Erik, Sounds like we ended up working on the same issue at about the same time.
      Great to hear you have a basic path forwards. I am very much a fan of the open source ModularSensors and EnviroDIY which covers a lot of functionality.

      However, it is a matrix of south bound (away from internet) instrument sensor interfaces ~~which are fantastic~~ and north bound (towards internet) communication interfaces.
      I personally have just a few configurations that I’m trying to build for the future, very much with RS485/12V (and SDI12/5V as instruments support it).
      From the software engineering aspect of the open source, there is no regression defined. So I’m attempting a definition of that.
      SO interested how it works for you.

      in reply to: RS485 without auto direction control #13492
      neilh20
      Participant

        Sara sorry about the stomach bug. Life is challenging when the rulers of the internal ecology get distracted with nasty bug invasions.

        thanks for the fix ~ I just noticed this conversation today.

        I think it was working with the AVR compiler as I had it all working for many months on a Mayfly (except that specific riparian monitoring Mayfly got stolen a couple of months ago). I’ve seen this problem before, that the AVR compiler has some defensive won’t execute a NULL pointer. Which is great. The NULL pointer came up in the ARM context, but I hadn’t regression tested it with the AVR.

        I haven’t looked at this AVR Mayfly RS485 DIR management as its a streams based environment. That is where the Auto Direction SOM works very nicely. I had no problems with it.

        Apologies if this is repeating something that everyone knows;
        Modbus is a packet of information. At the begin of the packet the RS485 driver half duplex goes to transmit, and then only when the complete Modbus msg is sent does the RS485 driver revert to receive.
        The reverting to receive is critical hard real time, as the modbus slave starts to respond shortly afterwards and I believe its specified at 3.5Character timings or about 3.5mS. Modbus also specifies for a packet that there should never be a gap between characters of more than 1.5Character timings or about 1.5mS.
        The RS485 SOM does this with a simple hardware timing. Resistor, Cap, Diode and buffer(schmitt trigger) I believe.
        For a streams based environment I believe its challenging.
        I did investigate this for an Ubuntu Linux build and compiled in a different set of drivers for an RS485 mode.
        For the streams based environment, turning the driver to transmit is easy and can be done before starting writing to the stream.
        However it requires an accurate time to detect, not just when the last byte in the packet is written to the hardware (and how does a stream know its the last byte especially if there is a multibyte FIFO for the Tx UART) but when that byte has completed transmission through the UART. So for a stream based environment, the driver needs to start a timer whenever the UART end of character interrupt is received, and if another character isn’t written into the UART in 1.5character timings (a 1.5mS) then it needs to switch the direction to receive.
        In the world of industrial designed systems for Modbus there are a number of potential solutions a) design a packet based interface for the Mega1280 UART- the UART supports end-of-byte transmission, but the driver guarenttees the Rx switch. b) use a MAX1348 driver which also has auto direction, but it requires +5V c) using a processor with UART that supports RS485 like the SAM51

        Well Solstice Salutations to everyone, I hope you have a good holiday – and that there is harmony with the anthropogenic masters, the gastric microbial ecology!.

        in reply to: Parameter Threshold Notifications #13390
        neilh20
        Participant

          Thanks for the front door 🙂 eTree was going down a whirly pooll!

          This worked for me, though maybe there is a nicer way.
          The output is value_num – which can be used for the threshold check.

          The retrieved ‘sites_values_dict’ is

          The debug out looks like this

          in reply to: Parameter Threshold Notifications #13386
          neilh20
          Participant

            Thanks for ulmo reference – I can sort of see something there, but its got a lot of layers and I can see it understands the response from a http://data.wikiwatershed.org/wofpy/rest/1_1/GetValues?
            of the form
            <timeSeriesResponse xmlns=”http://www.cuahsi.org/waterML/1.1/&#8221; xmlns:ns0=”http://www.cuahsi.org/his/1.1/ws/”&gt;

            Well in the spirit of try many things, be prepared to fail, I’m putting aside trying to understand the namespaces built in here defined by
            xmlns=”http://www.cuahsi.org/waterML/1.1/&#8221; xmlns:ns0=”http://www.cuahsi.org/his/1.1/ws/&#8221;

            So just an FYI if there are an XML gurus, I’m trying to retrieve the simple value, and whenever I try to search down using xml.etree.ElementTree I can’t null out the effects of xmlns and xmlns:ns0.

            A sensor value is encoded as “timeSeries” and shows

            in reply to: Parameter Threshold Notifications #13376
            neilh20
            Participant

              On the ThingSpeak thanks for pointing it out – they have become painful. I have a number of legacy connections I’m setup up for.

              Not knowing the architecture of the ODM2/WOF and WaterML 1.1 it was more of a reference.
              Thingspeak used to be a lot more open, but Mathwork$ acquired them, and I guess they are making money out of it.
              Which is to be expected, but I so appreciate enviroDIY coming along for environmental monitoring (and thanks to the NSF and William Penn Foundation funders)

              I am digging into Python libs in parsing the WaterML – but if you have any examples on getting to the data that would be great.

              in reply to: Parameter Threshold Notifications #13367
              neilh20
              Participant

                OK I think I’ve figured out something. I can only get the last variable at the moment (432) .. which is what I need for my real analysis of looking at the last value of the voltage returned and and checking it it has dropped below a threshold.

                http://data.envirodiy.org/sites/TU-RC-01/ visually its 16.0V the first Battery Voltage “All_ExternalVoltage_Battery” and I can also see with a download of series=1906

                So then using
                http://data.wikiwatershed.org/wofpy/rest/1_1/GetValues?location=envirodiy:TU-RC-01&variable=envirodiy:All_ExternalVoltage_Battery
                comes back with something that includes

                <values>
                <value methodCode=”2″ qualityControlLevelCode=”1″ censorCode=”nc” dateTime=”2019-11-18T19:27:02″ dateTimeUTC=”2019-11-19T03:27:02″ sourceCode=”611″ timeOffset=”-08:00″>16.0</value>

                which seems like I read as

                <values>
                <value …>16.0</value>

                and its the 16.0 Volts that I’m after. So I need to parse to find that and compare it to my threshold.

                in reply to: Parameter Threshold Notifications #13365
                neilh20
                Participant

                  Gosh @srgdamiano wonderful!. ..

                  As every another question … (thankyou thankyou in advance)

                  So following the examples and trying for some GetValues on EnviroDIY_Mayfly_Temp from
                  https://data.envirodiy.org/sites/LCC45a3/
                  with this
                  http://data.wikiwatershed.org/wofpy/rest/1_1/GetValues?location=envirodiy:LCC45a3&variable=envirodiy:EnviroDIY_Mayfly_Temp&startDate=2019-09-01T00:00:00&endDate=2019-11-01T02:30:00

                  I get a response but no <values> that I would think I should get.
                  Any pointers – many thanks.

                  in reply to: Parameter Threshold Notifications #13358
                  neilh20
                  Participant

                    To piggy back on this discussion – I’m wondering if anybody (@srgdamiano?) knows if there is a way of doing a POST/GET to request data from the ODM database for the latest row, or be able to access latest readings via WaterML.
                    The readings POST structure is described here
                    https://github.com/ODM2/ODM2DataSharingPortal/blob/master/doc/example_rest_requests.md

                    https://www.envirodiy.org/midstream-making-real-time-data-publicly-available/ from early architecture suggest access through WOFpy

                    What I’m looking for is to be able setup elsewhere a periodic request on the latest reading to be able to do a threshold check.

                    I know I can request data from ThingSpeak in this fashion, just wondering if there is a spec for it for data.enviroDIY.org
                    many thanks

                    in reply to: Connecting XBee3 LTE to the internet #13319
                    neilh20
                    Participant

                      I had a similar problem – see my comment in https://www.envirodiy.org/topic/trouble-registering-with-lte-m-network-on-hologram/
                      The fix that seemed to work was if it didn’t connect after a 100 AI status polls it issues
                      gsmModem.sendAT(GF(“+CREG”));
                      Search for +CREG in
                      https://github.com/neilh10/ModularSensors/blob/rel1_dvlp1m/src/modems/DigiXBeeCellularTransparent.cpp

                      My Hologram with data connection every 4hrs looks like this – pink is no session , blue is with data

                      in reply to: Trouble registering with LTE-M network on Hologram #13252
                      neilh20
                      Participant

                        Yup – the network is challenging when making it work, and adding to the biggest and most diverse machine in the world.
                        I’ve been more the old wireline, POTS to ISDN (now ADSL) – moving the analog to the CircuitSwitched Digital, and now its packet switched.

                        Though when I was working with one customer, when our product wasn’t connecting to the bigger machines, he referred to us being on the “Bleeding Edge” (the other side of cutting edge).
                        It actually turned out our product was working, but we interworking with a German device that wasn’t coping with US standards.
                        That’s why its nice to know about the 7Layer OSI model to have some common language about what the scope of the discussion is.
                        A lot of the 2G v 3G v 4G is industry fashion, bands of specifications, the reality is related to very specific specifications which evolve slower than 2G->3G->4G. The cellular industry is coping with high bandwidth expectations (5G), as well as low bandwidth IoT.
                        Whatever the technology, what does it take for my packets to be delivered successfully at what cost of power and devices.
                        I have heard of new silicon that can have problems with memory deep inside the chip – debugging that is hard.
                        For manuals I’ve been using mostly the
                        “Digi XBee3® Cellular LTE-M_NB-IoT 90002258revLsept2019.pdf”
                        https://www.digi.com/resources/documentation/digidocs/PDFs/90002258.pdf
                        though I’ve seen the questions and advice in various support forums about the Sara-R4.
                        Again thanks for the details on CREG – I’m mostly a niche usage for some environmental monitoring I’m supporting.
                        When my bit is stable I’ll put it in a wiki.

                      Viewing 10 posts - 291 through 300 (of 371 total)