Kgray44 / Talking-High-Temperature-Sensor

This is a repository for my tutorial over on Hackster! This project is a wood / pellet stove temperature monitor that talks though also, to give you verbal updates periodically!
MIT License
0 stars 0 forks source link

Com Port Issue / Dim LCD #2

Closed BAKova closed 8 months ago

BAKova commented 9 months ago

I was finally able to get the com port to come up, I had to add the com/lpt legacy device to Windows 11 in order to establish communications. So now I'm able to select COM4 in the Arduino IDE program to match the assigned port in windows. On to the next and hopefully last issue. When I sellect upload the program goes through the compile without issue, starts the upload and then returns the error message below. I have tried both Arduino LLC (www.arduino.cc) and Arduino Sri (www.arduino.org) manufacturers, both list the Arduino Leonardo model for the device to be added and Arduino IDE indicates that the Arduino Leonardo is connected on COM4 Screenshot 2024-01-21 125050 This is the windows error port error1 I have also checked for driver updates and they have all been current. Lastly, I noted in my research that the Arduino Leonardo is shown listed in "Software Devices" in windows with I assume its' own driver, I have no idea how to add this in or if it's required.

BAKova commented 9 months ago

port error1

BAKova commented 8 months ago

Changed the windows com/lpt ports to electronic team virtual ports and the connection errors have now been corrected. However, when I run upload I get these errrors. I have ordered a new usb cable by the off chance this is the problem. image

Kgray44 commented 8 months ago

Hi @BAKova

Changed the windows com/lpt ports to electronic team virtual ports and the connection errors have now been corrected.

Great! Glad you got that to work.

However, when I run upload I get these errors. I have ordered a new USB cable by the off chance this is the problem.

I am not a Windows user, so I am not exactly sure of all the possibilities for that error, but the USB cable can definitely be the problem. Some USB cables are only power cables, not power and data, so that would cause that issue if it is a USB power cable.

BAKova commented 8 months ago

Got the new cable, same issue. Can you reach out to one of your associates who is familiar with windows 11 and see if they can give me any help. image

BAKova commented 8 months ago

I have borrowed a Mac and loaded Arbuino IDE and tried to upload the program, It returned the same errors as above. I don't know what this butterfly is, can you explain it? Is it a piece of hardware that I'm missing? I've spent a fair amout of time and $$ on this and would really like to get it resolved ASAP

Kgray44 commented 8 months ago

Hi @BAKova

Sorry, I have been very busy lately.

The official advice is to press and hold reset on the board, click upload, wait for the code to compile and for the status bar to say 'Uploading...' and then release the reset button on the board.

See here: https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc6

BAKova commented 8 months ago

I'm missing something, there is no visible reset button on the voice recorder board

Kgray44 commented 8 months ago

Hi @BAKova

Oh, no.

You are not to upload the code to the voice recorder board, ever. Act like the USB port on that part is only to give you access to its storage (like a USB drive).

You program (upload the code) to the Beetle. You will need a USB-A to micro-USB cable; plug the beetle into your computer with it. Now, hit the upload button, and if it gives you the same error, try the advice in my last comment:

The official advice is to press and hold reset on the board, click upload, wait for the code to compile and for the status bar to say 'Uploading...' and then release the reset button on the board.

See here: https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc6

BAKova commented 8 months ago

Missed the instruction on upload to the beetle, my mistake. However, I tried what you suggested with both a MAC and Windows 11, same errors are returned. I tried this with 2 differeeeeeent cables. I've ordered a new micro data cable but I'm not confident this will fix the issue. Any other ideas?

BAKova commented 8 months ago

was able to get the windows com port to work without errors but now get thi message image

BAKova commented 8 months ago

I got the new cable reset the beetle all worked as described and it indicates upload was complete. So how do I get the assembled device to turn on and start working? image

Kgray44 commented 8 months ago

Hi @BAKova

If you uploaded the code correctly, the display will immediately display the information and turn the correct color. Depending on the temperature and the temperature fluctuation you may not hear a voice update for up to 50 minutes. Is your display loading correctly?

You just need to plug the micro-USB cable from the beetle into a wall USB port to power it.

BAKova commented 8 months ago

No. the display is black never comes on . when I plug into either usb the voice recorder comes in Japanese I'm guessing but that's it. under normal use should the system be powered through the vioice usb, beetle usb or a separate 5VDC supply. Is there anyway to chech to see if the program has actually been up loaded? I assume it's stored on the beetle?

BAKova commented 8 months ago

I ran upload with "Verbose" activated and it would appear to me that the file was successfully uploaded, please review the attached file and confirm. I did notice in the record thatit connected through COM port 9. however, the board is configured to COM port 7, can you explain this difference. LCD display is still black. verbose upload.txt

BAKova commented 8 months ago

Sucess! I finally got it to work, however, the LCD display is disapointingly dim and difficult to see and it is only functional with either the beetle USB cable or a separate 5VDC supply, I can work with that. but is there a way to increase the brightness of the display?

BAKova commented 8 months ago

I really would like an answer on the display, I uploaded the RGBLCD example to the Beetle and the same result I can barely read the display. It's basically black with very faint letters. I've seen this issue on line but can't find a resolution.

Kgray44 commented 8 months ago

Hi @BAKova

That is strange; I have never had that issue.

I just updated the "talkingtemp.ino" file. Try downloading it again and then reuploading it to the Beetle. It might fix it!

If that doesn't fix it, you can contact DFRobot customer service at techsupport@dfrobot.com, as this sounds like it might be a product / hardware issue.

BAKova commented 8 months ago

Yes the update code fixed the display issue, was it something simple or do I need to edit the new program?

Kgray44 commented 8 months ago

Hi @BAKova

Great! It was very simple. When I built and published the project, there was no need to include the LCD's I2C address in the declaration (this line: DFRobot_RGBLCD1602 lcd(/*RGBAddr*/0x2D,/*lcdCols*/16,/*lcdRows*/2);). So I added the '/RGBAddr/0x2D' piece, just in case its omission was the issue, and that seems to have been the solution.

Is everything with your device working correctly now? Does the Voice Recognition Module work fine?

BAKova commented 8 months ago

Everything seems to work except it's loading the Japanese message at each verbal alarm message, not my recorded messages. Can you explain the file structure better, I've saved my recordings as FILE000X and loaded them to the voice module and changed the program to call (1) for example, is the actual file name and path required?

Kgray44 commented 8 months ago

Hi @BAKova

Did you follow my directions here exactly?

Now you can use a text-to-speech website to turn your phrases into audio files (MP3)! There are many, but the one I used is voicemaker.in. Because I used the free version though, my project sounds like a robot since I was unable to use the better voice options without paying.

After you have all of your audio files downloaded, they all need to be renamed. The naming format is "FILE00[filenumber].MP3".

So for example, "FILE0007.MP3". I wrote down which audio file was which number, that way I could keep track when I wrote the code.

After all of your audio files are renamed, plug in the Voice Recorder module, and transfer them into the single file found on the disk! The best way is to open the module like an external memory in Finder, open the single file inside, and drag your audio files into it.

Eject your Voice Recorder module, and you are finished!

Can you please post your modified code?

BAKova commented 8 months ago

Modified code attached, after formatting the voice recorder module there is no file to move my files to. I'm thinking you mean directory, but there isn't one of those either. So they are on the root, I recorded MP3 files in my own voice and renamed them as you indicated FILE0000 to FILE0005. I'm sure I'm missing something simple Stove1_Program.txt

BAKova commented 8 months ago

include

include

include

include

float temp=0; float lasttemp=0; float fpm=0;

unsigned long lastmillis=0; unsigned long lastamillis=0;

bool active = true; bool extraactive = false; bool off = false; bool announced = false;

DFRobot_RGBLCD1602 lcd(/RGBAddr/0X2D,/lcdCols/16,/lcdRows/2); //16 characters and 2 lines of show DFRobot_MAX31855 max31855; SoftwareSerial df1101sSerial(9, 10); //RX TX DFRobot_DF1101S df1101s;

void setup() { Serial.begin(115200); df1101sSerial.begin(115200);

lcd.init();

if (!df1101s.begin(df1101sSerial)){ Serial.println("Init failed, please check the wire connection!"); delay(1000); }

/Set volume to 20/ df1101s.setVol(100); Serial.print("VOL:"); /Get volume/ Serial.println(df1101s.getVol()); /Enter music mode/ df1101s.switchFunction(df1101s.MUSIC); /Wait for the end of prompt tone/ delay(2000); /Set playback mode to "repeat all"/ df1101s.setPlayMode(df1101s.ALLCYCLE); Serial.print("PlayMode:"); /Get playback mode/ Serial.println(df1101s.getPlayMode());

df1101s.setPrompt(false);

lasttemp = temperature(true); }

void loop() { display(temperature(true));

if (millis() - lastmillis > 30000){//check temperature announcements once per 30 seconds Serial.println("Checking announcements..."); announcements(temperature(true)); }

if (active){//if temperature is fluctuating a lot, announce quicker (10 minutes) if (millis() - lastamillis > 6000012){//10 minutes if (!off){ announced = false; Serial.println("Reset 'announced'"); lastamillis = millis(); } } } else if (extraactive){ if (millis() - lastamillis > 600004){//4 minutes if (!off){ announced = false; Serial.println("Reset 'announced'"); lastamillis = millis(); } } } else {//if not, announce slower (45 minutes) if (millis() - lastamillis > 60000*50){//45 minutes if (!off){ announced = false; Serial.println("Reset 'announced'"); lastamillis = millis(); } } }

}

float temperature(bool F){ float t=0;

/Read Celsius and F/ if (!F){ t = max31855.readCelsius(); } else { t = (max31855.readCelsius()*1.8)+32; } Serial.print("Temperature:"); Serial.println(t); return t; }

void display(float t){ lcd.setCursor(0,0); lcd.print("Temp (F): "); lcd.print(t,1); lcd.setCursor(0,1); if (t <= 300){ lcd.setRGB(255,255,0);//yellow lcd.print("Creosote"); } else if (t > 300 && t <= 450){ lcd.setRGB(0,255,0); lcd.print("Optimal"); } else if (t > 525){ lcd.setRGB(255,0,0); lcd.print("Overfire"); } lcd.setCursor(9,1); lcd.print("FPM:"); lcd.print(fpm); }

void announcements(float temp){ if (abs(temp - lasttemp) >= 2 && abs(temp - lasttemp) < 5){//if the temperature is moving quite fast, set active value to true (for shorter delay between announcements) active = true; } else {active = false;} if (abs(temp - lasttemp) >= 5){ extraactive = true; } else {extraactive = false;} Serial.println(temp - lasttemp);

if (temp < 250){ if (!announced){ //need more wood df1101s.playSpecFile(1);//6 delay(4000); announced = true; active = false; extraactive = false; } }

if ((temp - lasttemp <= -0.9) && (temp - lasttemp > -1.7)){ if (temp < 200){ if (!announced){ //going out df1101s.playSpecFile(2);//7 delay(4000); announced = true; } } } else if ((temp - lasttemp <= -1.7)){ if (temp < 310){ if (!announced){ //getting cold fast df1101s.playSpecFile(2);//6 delay(4000); announced = true; } } } else if ((temp - lasttemp >= 2) && (temp - lasttemp < 4)){ if (temp > 325){ if (!announced){ //warming up df1101s.playSpecFile(3);//8 delay(4000); announced = true; } } } else if (temp - lasttemp >= 4){ if (temp > 400){ if (!announced){ //getting hot fast df1101s.playSpecFile(4);//9 delay(4000); announced = true; } } if (temp > 525 && temp <= 525){ if (!announced){ //getting hot too fast df1101s.playSpecFile(0);//10 delay(4000); announced = true; } } if (temp > 575){ if (!announced){ //getting hot too fast df1101s.playSpecFile(5);//10 delay(4000); announced = true; } } } if (temp <= 125){ if (temp - lasttemp <= 0.3){ off = true; } else { off = false; } } Serial.print("Last temp:"); Serial.println(lasttemp); fpm = temp - lasttemp; Serial.print("F per minute:"); Serial.println(fpm); lasttemp = temp; lastmillis = millis();

}

BAKova commented 8 months ago

is it possible that I have the wrong SoftwareSerial.h loaded? I'm assuming this a library. Or is it automatically installed with DF1101s.h library?

BAKova commented 8 months ago

Will you be able to help me with this last issue, or not?