Bus Lock Issues

Expansion modules and attachments
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Bus Lock Issues

Post by Marshall O »

Hi all. I just installed an expansion hub, water level & RF expansions. The RF expansion is causing bus locks. I read as much as I could already on how to fix or work around it, but nothing has worked yet. I switched the port on the expansion hub that the RF was plugged into. I also tried to update the firmware per this post: viewtopic.php?p=41152#p41152

I believe I did it right (it flashed red 3 times after it was complete), but it did not blink cyan or magenta when plugged back in (just red). It locked up again last night (luckily with my heaters on, so the tank only got to 78.6° vs. dropping way down in temp!). I have since unplugged the RF expansion.

The only other thing I saw was with how you code the RF. What I would like mine to do is read from the internal memory by default, go into feeding mode during feeding, NutrientTransport mode @ 100% for 10 minutes after feeding, and ReefCrest @50% during the night. Here is my code (I just started to play with it yesterday, so I am sure there are better ways to do this!):

Code: Select all

ReefAngel.RF.UseMemory=true;

  static unsigned long FeedTime;
  if (ReefAngel.DisplayedMenu==FEEDING_MODE) FeedTime=now();
  
  if (now()-FeedTime>0 && now()-FeedTime<600)
  {
    // Continue NTM for the 10 minutes
    ReefAngel.RF.UseMemory=false;
    ReefAngel.RF.SetMode(Smart_NTM,100,5);
  }
    else if (hour()<8 || hour()>23) 
  { // 8:00am / 11:00pm
  // Night mode (go to 50%)
  ReefAngel.RF.UseMemory=false;
  ReefAngel.RF.SetMode( ReefCrest,50,0);
  }
  else 
  {
    ReefAngel.RF.SetMode(Feeding_Stop,0,0);
    ReefAngel.RF.UseMemory=true; // Will reset all values from memory
  }
Any help is appreciated!!
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Bus Lock Issues

Post by lnevo »

The RF module shouldn't stay red. It should change colors when you change modes. I think mine did that after I updated the firmware as well and I had to reset everything. Full power off of all modules, etc. But the firmware made a big difference on my end.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

lnevo wrote:The RF module shouldn't stay red. It should change colors when you change modes. I think mine did that after I updated the firmware as well and I had to reset everything. Full power off of all modules, etc. But the firmware made a big difference on my end.
Sorry, I wasn't clear. The RF did not stay red. It flashed red, then went back to white like normal. It did not flash blue and magenta like I thought it would, so I'm thinking it did not update.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Bus Lock Issues

Post by lnevo »

I think we need roberto to chime in i dont remember the process enough
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

The module only blinks red after an update I think.
It should change colors according to whatever mode you have set though.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:The module only blinks red after an update I think.
It should change colors according to whatever mode you have set though.
Ok, which it did. So I guess it did update, but did not solve the problem? Is there anything else I can try?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

I want to try this:
1. Open RF.cpp on notepad, which is located at Documents\Arduino\libraries\RF
2. Locate line 62:

Code: Select all

if (millis()%60000<200) lastcrc=-1;
3. Comment it out by adding // in front of it:

Code: Select all

//if (millis()%60000<200) lastcrc=-1;
4. Save the file
5. Upload your code again.
Let me know how it goes.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

Thanks Roberto. Just did it. I will let you know!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Do you have wifi attachment?
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:Do you have wifi attachment?
Yes.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Is it connected?
I can't seem to be able to see history of your controller.
It must be the space in your forum name or something else.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:Is it connected?
I can't seem to be able to see history of your controller.
It must be the space in your forum name or something else.
Yes, its connected. My portal shows up fine? Here is how its coded:

Code: Select all

ReefAngel.Portal("Marshall%O");
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

And I just checked, and I already have a Bus Lock :(
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

Just tried to update the firmware again, to make sure it went. I added
"@echo off
cmd"
to the Update.bat file to see what happened. Turns out it did not work. Here it is below:


C:\Program Files (x86)\Reef Angel Controller>avrdude -Cavrdude.conf -v -patmega3
28p -carduino -P\\.\COM3 -b115200 -D -Uflash:w:RF_Update_Bus_Check.hex:i

avrdude: Version 6.0, compiled on Apr 6 2012 at 19:29:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "avrdude.conf"

Using Port : \\.\COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
Rebooting Reef Angel Controller
avrdude: stk500_getsync(): not in sync: resp=0x20

avrdude done. Thank you.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Program Files (x86)\Reef Angel Controller>


Am I missing something?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Did you edit the file to use the correct COM port?
Is COM3 the port you use to upload codes to your RA?
For you portal code, change it to this:

Code: Select all

ReefAngel.Portal("Marshall%20O");
It will enable you to get history in the correct forum id.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:Did you edit the file to use the correct COM port?
Is COM3 the port you use to upload codes to your RA?
For you portal code, change it to this:

Code: Select all

ReefAngel.Portal("Marshall%20O");
It will enable you to get history in the correct forum id.
Yes, I use COM3 to upload to RA.

And thank you, I will make that portal ID change now!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Make sure you unplug from the usb cable that connects to RA hub.
When you initially plug the programming cable, does the RF module blink red 3 times?
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:Make sure you unplug from the usb cable that connects to RA hub.
When you initially plug the programming cable, does the RF module blink red 3 times?
To make sure we are on the same page, I unplug the USB on the RF, but have left the USB connected at the hub. Does that matter?

And yes, when I plug the USB-TTL into the RF module, it blinks red 3 times.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

As long as it is not connected to RF, it doesn't matter.
Does it also blink three times when you execute update.bat?
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

Ok good.

It blinks red 3 times at each step while trying to update, as soon as it starts, twice while it tries to update, and once more once it is complete.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

That's what it is supposed to do.
But it should upload in the middle.
Ahh..
Did you remove the RF module when uploading the code?
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:That's what it is supposed to do.
But it should upload in the middle.
Ahh..
Did you remove the RF module when uploading the code?
Negative :( I have tried it at least 10 times. I even tried uploading the original firmware (RF_Update), and it does the same.


C:\Users\ohearn\Documents\Arduino\Original RF Firmware>avrdude -Cavrdude.conf -v
-patmega328p -carduino -P//./COM3 -b115200 -D -Uflash:w:RF_Update.hex:i

avrdude: Version 6.0, compiled on Apr 6 2012 at 19:29:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "avrdude.conf"

Using Port : \\.\COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
Rebooting Reef Angel Controller
avrdude: stk500_getsync(): not in sync: resp=0x20

avrdude done. Thank you.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\ohearn\Documents\Arduino\Original RF Firmware>


I'm assuming if it worked correctly, it would do something besides saying "not in sync", correct?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

You must remove the rf module to upload codes
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:You must remove the rf module to upload codes
Sorry, I guess I did not understand your original question. I can't remember if the RF module was installed when I last uploaded my code. So I just did it again, with the RF module removed. I still could not get the RF module itself updated, but if your fix to the RF.cpp works, then I guess it won't matter anyways.

I will update either if I get another Bus Lock, or hopefully later on tonight with some success!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

It is very important to remove the ecotech RF board from the module prior to updating the module or it will definitely fail.
Make sure to detach it and put it aside.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:It is very important to remove the ecotech RF board from the module prior to updating the module or it will definitely fail.
Make sure to detach it and put it aside.
Again, I misunderstood what you were asking! Now I understand :) I removed the Ecotech board, did the update (which of course now worked fine!), and reinstalled it. I guess I should be good to go now.

So sorry about the misunderstanding of physically removing the Ecotech board. Thank you so much for all of your help though!
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

Following up on this, the firmware update works as it should, checking for Bus Locks every 5 minutes and then clearing. My question is, does the Bus Lock turn on relays for other people? Some of the times it just locks, and does not turn on or off any relays. Other times, it will turn on some or all relays that are off. This caused me to already have to change out my ATO pump, as it was dumping in gallons of water when the relay kicked on and stayed on for a couple of minutes before the bus lock was cleared. That and it is turning on my lights at times when then should be off. Last night they came on at about 9:45PM. Normally when the bus lock clears, it turns them back off. This time, they stayed on. I had to manually turn them off around 10:15PM after it was clear they were not turning back off. I am not sure if it changed the time on my controller, or what the problem was (I did it from my phone). When I woke up this morning, they were back to running in auto (and so they were off).

I am going to be going away on vacation for a week shortly. I certainly don't want to be worried about my lights being locked on throughout the night. That has already happened to me in the past, and I ended up losing a lot of corals. So, I am just seeing if this happens to anyone else, and if there is any kind of a fix.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

This is definitely not normal.
I think the bus lock is messing with your clock and that's why the lights kicked on.
But, you are getting way too many bus locks.
Are you using the original USB cable that came with the modules?
What other modules do you have?
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:This is definitely not normal.
I think the bus lock is messing with your clock and that's why the lights kicked on.
But, you are getting way too many bus locks.
Are you using the original USB cable that came with the modules?
What other modules do you have?
Yes, I am using all original USB cables that were supplied. I have the WiFi attachment, expansion hub, single water level, and RF module. I got at least 18 bus locks yesterday (I setup and email notification yesterday morning for it). I turned the email notification off this morning as I was getting way too many emails!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Yeah, I know. I looked at your history.
Does the problem persist if you remove the RF module?
Roberto.
Post Reply