OpenSprinkler › Forums › Hardware Questions › OpenSprinkler › OS 3.0 Lan Adapter
- This topic has 25 replies, 4 voices, and was last updated 3 years, 4 months ago by FelipeRojas.
-
AuthorPosts
-
June 3, 2019 at 12:41 pm #60807
dun4cheapParticipantAnyone know if the now available lan adapter option for the OS3 will work for all of the OS3’s? Also does it limit the amount of zones?
Thanks
June 8, 2019 at 7:24 pm #60925
RayKeymasterI’ve already communicated with you offline, but as a public record: the version with wired Ethernet module (officially numbered OS 3.2) is a very recent release. Only the recently purchased (like May 2019 and onward) OS 3 controllers are compatible with the Ethernet module, the previous versions use different sets of pins and are not compatible with the module.
I will make an official announcement of OS 3.2 shortly. The short story is that capability wise, it’s the same with all OS 3’s, except it has a cable that can link to a wired Ethernet module (ENC28J60-based). When the Ethernet module is plugged in, the controller functions in wired Ethernet mode; otherwise it’s in WiFi mode. It currently doesn’t support both at the same time, but will function in one or the other depending on whether the module is plugged in or not. Over-the-air firmware update is only supported in WiFi mode (so you can temporarily remove the Ethernet module, update firmware in WiFi mode, then plug in the Ethernet module again). Other than this feature, there is no distinction between OS 3.2 and other OS 3’s. The expanders are the same for all of them.
August 25, 2019 at 1:22 pm #62330
rastafdParticipanthi,
i have build a 3.0 version and wired a enc28j60 to it but it dose not work. i have to disconnect the pcf8574 then is work. how come?
its seems to work only if it detect a 3.2 version. but i don’t have a Pca9555 on hand only pcf8574 and pcf8575.thanks
August 26, 2019 at 7:23 am #62346
rastafdParticipanthi,
i have build a 3.0 version and wired a enc28j60 to it but it dose not work. i have to disconnect the pcf8574 then is work. how come?
its seems to work only if it detect a 3.2 version. but i don’t have a Pca9555 on hand only pcf8574 and pcf8575.thanks
August 26, 2019 at 10:49 am #62350
RayKeymasterSince you built your own hardware, it’s really hard to tell. Which schematic did you follow? The only version that supports ethernet is OS 3.2:
https://github.com/OpenSprinkler/OpenSprinkler-Hardware/tree/master/OS/3.0/Master
yes the firmware detects the specific hardware version. ENC28J60 uses SPI, which requires 4 GPIO pins. Only version 3.2 made the SPI GPIOS available for ENC28J60, all previous versions use some of the SPI pins for other purposes.August 29, 2019 at 7:35 am #62387
rastafdParticipantThanks for the reply i will ordre some pca9555. Here a picture of my oppensprinkler. You did a great job.
The only thing missing is one siol moisture for each zone . That way it will be use for multiple plant watringAugust 29, 2019 at 9:02 am #62396
RayKeymasterYour picture was not successfully uploaded. You can try to reduce the size and upload again, or upload it to Google photos or anywhere photo site that you can share a link to.
August 31, 2019 at 5:54 am #62412
rastafdParticipantHere it is
Attachments:
August 31, 2019 at 9:32 am #62420
RayKeymasterSince you are using a 8-zone relay board: one thing you need to be careful with is not double use any GPIO pin for two purposes. ESP8266 has a fairly small number of GPIO pins, if each of your relay takes over one pin, I don’t know how you can manage to also have ENC28J60 (requires SPI, 4 pins) and LCD (requires I2C, specifically GP4 and GP5). The total seems to exceed the number of available GPIO pins, so I assume some of your relay pins are shared with either SPI or LCD, and that will definitely cause problems. This is the reason OS 3 uses I2C expander for zone control, so that it uses the same I2C bus and can still expand to a large number of zones.
August 31, 2019 at 10:25 am #62423
rastafdParticipantThe ecn26j60 will only work if i disconnect the 2 pfc8574, But i don’t have any relays working
For now the enc28j60 is not working . There is a pcf8574 x20 under the nodemcu for the button. The relays are connected to the red pcf8574 x22 that you can see. The way i understand it is when i receive the pca9555 and address it to x22 and remove the 2 pcf8574 the system will detect version 3.2 and the enc28j60 will work and the relays.
September 1, 2019 at 11:13 am #62434
RayKeymaster“The ecn26j60 will only work if i disconnect the 2 pfc8574, But i don’t have any relays working” — that’s just because the firmware detects the existence of these chips to tell which version of hardware it is, and as you know, it only enabled ENC28J60 for OS 3.2. There is a good reason for that, because earlier hardware versions use some of the SPI pins for other purposes, so if you enable ENC28J60 for the earlier hardware versions, then those SPI pins will have unexpected behavior that should be avoided. So my suggestion really is to follow OS 3.2 design.
September 15, 2019 at 12:11 am #62595
rastafdParticipantreceived the pca9555 and rewired everything. all seems fine except the trigger from the pca9555 seems to have change to high and before it was low.
is this normal? or i am missing something.
is there a easy fix.
thanks
September 16, 2019 at 3:35 pm #62613
RayKeymaster“the trigger from the pca9555 seems to have change to high and before it was low” — I don’t fully understand this. Do you mean the ‘output from pca9555’ is previously low and is now high? There are 16 IO pins on pca9555, which ones are you referring to?
September 16, 2019 at 7:00 pm #62616
rastafdParticipanthi,
not exactly,
to activate the 8 stations whit my previous setup, pcf8574, the pcf8574 send low “0V” to active the relay board.
and now the pca9555, it send high “5V” to activate my 8 channel relay.
so previously, pcf8574, wen a activate a station the relay activated and now 9ca9555 the relay is always activated except wen a start a station.
does that make scene?
September 17, 2019 at 9:13 am #62628
RayKeymasterAh, ok, yes, that’s correct. Here are the details: previously, with PCF8574, it uses P-channel MOSFET on each output (because 8574 cannot drive high current load), so the logic is reversed. With PCA9555, because it uses Totem output, the output can drive high current load in both high and low states, so there is no such inversion. You can take a look at the source code:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/OpenSprinkler.cpp#L1041
which shows the difference with using PCF8574 vs. PCA9555.Your relay board is probably active-low type, which explains why it works with PCA8574 out of box, since it matches the reversed logic. There are two solutions for you: one is to modify the source code to reverse the bits for PCA955 in exactly the same way as PCA8574; the other is to replace your relay board by using active-high type.
September 17, 2019 at 6:18 pm #62638
rastafdParticipanti was afraid that was the answer :-).
i had a lot of trouble compiling the code whit Arduino ide on windows . son i took my linux computer and was able to add the tiny character “~” to reverse the trigger. and thanks for pointing me to the right file.
everything now is working.
the repository on github is not the 2.1.8 (6) only 2.1.8 (4) is that correct?September 18, 2019 at 11:53 am #62647
rastafdParticipanti think that i found the answer. it is in the branch ether4os32?
September 18, 2019 at 2:19 pm #62649
RayKeymasterYes, minor revision (6) is in the ether4os32 branch. Will merge that to master shortly.
September 19, 2019 at 7:11 pm #62655
rastafdParticipantgreat. thanks it work perfectly
December 20, 2019 at 6:43 pm #63725
litronasParticipantHi, I’m very novice but I built 3.2, but the relays are going badly for me. I need to change the output, but my English is very bad and I can’t find where in the .cpp file.
The same happens to me as my partner.
Is there an easy way to do it?thanks to everyone.
Sorry for the Google translation.
December 23, 2019 at 4:10 pm #63742
litronasParticipantIn the end I put transistors and correct the outputs. great job. I love it, it hurts not to have a garden …
December 23, 2019 at 5:22 pm #63746
rastafdParticipanthi,
if you had the same “problem” that i have. find the section below in opensprinkler.cpp
you have to add ~ in the pca9555 section so it will look like this reg = (reg&0xFF00) | ~station_bits[0]; // output channels are the low 8-bit// Handle driver board (on main controller)
if(drio->type==IOEXP_TYPE_8574) {
/* revision 0 uses PCF8574 with active low logic, so all bits must be flipped */
drio->i2c_write(NXP_OUTPUT_REG, ~station_bits[0]);
} else if(drio->type==IOEXP_TYPE_9555) {
/* revision 1 uses PCA9555 with active high logic */
uint16_t reg = drio->i2c_read(NXP_OUTPUT_REG); // read current output reg value
reg = (reg&0xFF00) | station_bits[0]; // output channels are the low 8-bit
drio->i2c_write(NXP_OUTPUT_REG, reg); // write value to registerDecember 23, 2019 at 5:57 pm #63747
litronasParticipantthanks
September 7, 2021 at 9:03 pm #71094
FelipeRojasParticipantHello!
On the actual firmware i have setup a PCA9555 with an esp8266
I got the same problem. Actually on default status, the pca9555 is set on high, when you trigger an station it sends low.
I just wandering how to invert it.There is the issue:
i have edited this line on opensprinkler.cpp file. (actual line on this date 1120)reg = (reg&0xFF00) | station_bits[0];
to
reg = (reg&0xFF00) | ~station_bits[0];
Recompile and seems to be fine.
The defaultstatus is now low, but when i trigger an station… nothing happen.Also a bug:
The station 8 seems to be not working properly… the original code is not working (expected is goes to low)
on the modified firmware it goes to high, after finish the time, it continues high (the spected is to it goes to low)September 8, 2021 at 5:29 pm #71105
RayKeymasterFirst, this thread is now off topic: the title of the thread is “OS 3.0 Lan Adapter” but now it’s discussing firmware compilation issues. It would be good if you can create a new thread with an matching title.
If I understanding correctly from your description, it sounds like you are saying your station 8 behaves differently from the other stations. This seems more of a hardware problem — the reason is that the code does not single out station 8 in any way, it does the same thing to a whole byte, which corresponds to all 8 stations. If anything, you may want to check if your station_bits (it’s an array) is of type byte (aka uint8_t) or did you declare it to be some other type, like bool. If it’s not a byte type, I can certainly see it may produce different behaviors on station 8.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler › OS 3.0 Lan Adapter