Forum Replies Created
-
AuthorPosts
-
Chassy33ParticipantDan Christensen, I can confirm that this works. I compiled a default build with making no changes and could not set the station types to GPIO as there were no free pins listed in the PIN_FREE_LIST in defines.h. Then I modified the PIN_FREE_LIST to includes several pins and recompiled the code and now I can set the station type to GPIO and pick which PIN to use. I still need to actually connect some relays to the board, but it looks like this will work great!
Chassy33ParticipantDan,
Not gonna lie, I was reading through all my past exchange with Ray and have no idea what I did to make it work. I lost my compiled code when my external drive failed and was trying to replicate this a few weeks ago for another setup but gave up.
So are you saying that all I need to do is update the “PIN_FREE_LIST” with free GPIOs and then compile and then the UI will see them as available? I just want to confirm that I understand what you are saying.
Chassy33ParticipantRay,
I got it to work! I set the address to 0x21 (A0=0, A1=0, A2=1) which would be the AC Driver board, but if I only connect that single board to the ESP-8266, it sees it as the expansion board and utilizes its GPIOs for zones 9-24. this is perfectly fine with me as I just need to drive 8 zones and 1 master. But it just seemed like I would have to set the address to 0x24 for it to think it was an expansion. Regardless It is now working.
I was able to modify the firmware and reverse the OUTPUT state to make them all HIGH on the expansion board. Below is what I changed for anyone else that faces this issue:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/3c388712494393498b9fbdb2fa2725dc189f0a32/OpenSprinkler.cpp#L1129for(int i=0;i<MAX_EXT_BOARDS/2;i++) {
uint16_t data = station_bits[i*2+2];
data = (data<<8) + station_bits[i*2+1];
if(expanders[i]->type==IOEXP_TYPE_9555) {
expanders[i]->i2c_write(NXP_OUTPUT_REG, data);
} else {
expanders[i]->i2c_write(NXP_OUTPUT_REG, ~data);
}
}I edited the line “expanders[i]->i2c_write(NXP_OUTPUT_REG, data);” and reversed the “data” so it is now “expanders[i]->i2c_write(NXP_OUTPUT_REG, ~data);”
Thanks for you help!
Chassy33ParticipantRay,
Thanks for that description. It makes total sense now. I was confusing the driver board with expander boards. I was able to get it all working using 2 PCF8574 boards, but today my PCA9555 chips showed up! So I soldered a new board and have it all working as 0x21 and it triggers my relays. the issue is that all the PINs are low and my relays are active LOW. is there somewhere in the FW to modify to keep all the outputs HIGH? Looking through the PCA9555 datasheet it looks like it is default HIGH INPUT on boot. so I am assuming that the FW pulls them all LOW and OUTPUT, but I cannot find where that is. From looking I would assume its within the apply_all_station_bits() but I am not sure of that.
Thanks again for all you help with this! I am learning a lot!
Chassy33ParticipantI was under the impression that the first version used PCF8574 for main board and a separate PCF8574 for the expansion board. I had not seen that you used the PCF8575 expansion boards. So you are saying that if I have a board set as 0x24 it assumes its a PCF8575 rather than a PCF8574 and so it thinks that there are 16 stations per board? If that is the case, where would I modify the code to only send 1 byte rather than 2? I am assuming it is somewhere close to here?
I do have some PCA9555 on the way, but don’t know when they will get here. Plus at this point, its almost a challenge to get this working.
Chassy33ParticipantDuh that makes complete sense… Not sure what I was thinking. Thanks for the explanation. One other question. I am trying to get it to work using several PCF8574s.
I have the first I2C address set to 0x20 to tell the firmware that the version is 3.0. From my understanding, I cannot use any of the GPIOs on this chip for zones. Also without using this, If I hook up any other board, the ESP will not boot. So I have a second board with address 0x21 which is for AC driver and I can get it to trigger the first 8 zones, and the UI shows 8 zones available. Then if I hook up a board with address 0x24 which looks to be to address for the first expander board, the UI now says there are 24 stations available, but the GPIO on the 0x24 board drive zones 17-24. this continues on. each expander board with address 0x24-0/27 adds 16 more zones, but can only control 8 zones. I cannot get control of zones 9-16 no matter what I try. Is this normal?
Chassy33ParticipantRay,
Thanks for the super quick reply! I figured I was missing something. My question is this. If I edit the main.js to add another getHWVersion check for 3.2 (that seems to be what is the default when I flash to the ESP with no GPIO expander attached), how do I get that modified JS file to be included when I compile? Or is that JS file just called as a <script> tag in a HTML file? If that is the case then I would need to edit that HTML file as well, but once again, not sure how to get that included in the compile using the included make.lin32 file. Also I may be completely wrong on how I believe all of this works…
Thank you for all you work and help on this!
-
AuthorPosts