Compiles and Uploads from Windows but not Linux Mint

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
airscapes
 
Posts: 52
Joined: Mon Jan 25, 2016 12:24 pm

Compiles and Uploads from Windows but not Linux Mint

Post by airscapes »

Have a simple sketch that reads an analog sensor and triggers a relay. This runs on a trinket pro 5v and works perfectly. In the process of tweaking the on and off time I attempted to use my linux laptop as it was more portable than the windows laptop setup. This linux laptop has been used to compile and upload sketches to Trinket Pros using the FTDI cable last winter. Linux mint Cinnamon 20.3, Arduino is 18.19, usb port is USB0 and monitor works running at 9600. All preference settings that can be the exact same between windows and Linux are the same.
The cable can be moved from linux to windows and the sketch will upload so seems to be a Linux issue. The linux laptop is up to date and has been booted multiple times. I have tried this on multiple boards, I have built 3 of the same device. Any help is much appreciated.

output after upload
Sketch uses 3940 bytes (13%) of program storage space. Maximum is 28672 bytes.
Global variables use 265 bytes of dynamic memory.
avrdude: stk500_disable(): unknown response=0x30

Code: Select all

// SPDX-FileCopyrightText: 2011 Limor Fried/ladyada for Adafruit Industries
//
// SPDX-License-Identifier: MIT

// thermistor-2.ino Intermediate test program for a thermistor. Adafruit Learning System Tutorial
// https://learn.adafruit.com/thermistor/using-a-thermistor by Limor Fried, Adafruit Industries
// MIT License - please keep attribution and please consider buying parts from Adafruit

// which analog pin to connect
#define THERMISTORPIN A0         
// how many samples to take and average, more takes longer
// but is more 'smooth'
#define NUMSAMPLES 10
// the value of the 'other' resistor
#define SERIESRESISTOR 100000    
 
int samples[NUMSAMPLES];
int outputpin = 8;          // triggers relay driver
bool ison = false;          // devind ison as true/false for relay
 
void setup(void) {
  pinMode(outputpin, OUTPUT);                // pin that drives relay
  Serial.begin(9600);
  // connect AREF to 3.3V and use that as VCC, less noisy!
  analogReference(EXTERNAL);
}
 
void loop(void) {
  uint8_t i;
  float average;
 
  // take N samples in a row, with a slight delay
  for (i=0; i< NUMSAMPLES; i++) {
   samples[i] = analogRead(THERMISTORPIN);
   delay(10);
  }
 
  // average all the samples  `out
  average = 0;
  for (i=0; i< NUMSAMPLES; i++) {
     average += samples[i];
  }
  average /= NUMSAMPLES;
 
  Serial.print("Average analog reading "); 
  Serial.println(average);

  //Below on and off has to be set per sensor as the value are different from sensor to sensor 
  if (ison)   {                                 // will be true if we have turned on the power to the relay and fan
    if ( average > 483 ){                       // If we get bounce increase this 
      digitalWrite(outputpin, LOW);             // Turn off relay
      Serial.println("Relay Off");
      ison = false;
    }
  }else{
    if ( average < 470 ){
      digitalWrite(outputpin, HIGH);             // Turn on relay to run fan
      Serial.println("Relay On");
      ison = true;
    }
  }
  delay(1000);
}

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Compiles and Uploads from Windows but not Linux Mint

Post by mikeysklar »

Can you enable verbose output during upload (File --> Preferences)?

Then attempt to re-upload the sketch. Maybe there is something off about the selected board model, selected COMs port or other settings we can see.

User avatar
airscapes
 
Posts: 52
Joined: Mon Jan 25, 2016 12:24 pm

Re: Compiles and Uploads from Windows but not Linux Mint

Post by airscapes »

Wow that was enlightening, I could not see that verbose option for the nine times I looked..
So does this mean it was a non issue or is there still something now loading.. I mean

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/home/doug/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/doug/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 5.0
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/tmp/arduino_build_892273/Thermistor_fan_control.ino.hex"
avrdude: writing flash (3940 bytes):

Writing | ################################################## | 100% 1.49s

avrdude: 3940 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_892273/Thermistor_fan_control.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_892273/Thermistor_fan_control.ino.hex:
avrdude: input file /tmp/arduino_build_892273/Thermistor_fan_control.ino.hex contains 3940 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.33s

avrdude: verifying ...
avrdude: 3940 bytes of flash verified
avrdude: stk500_disable(): unknown response=0x30

avrdude done. Thank you.

User avatar
airscapes
 
Posts: 52
Joined: Mon Jan 25, 2016 12:24 pm

Re: Compiles and Uploads from Windows but not Linux Mint

Post by airscapes »

This is just crazy, I added a couple extra word to the print line that is sent to the console for each average reading and after uploading it, that error is gone.. wow I hate when this kind of stuff happens.
Thanks for the help, I guess it is time for new glasses :-(

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Compiles and Uploads from Windows but not Linux Mint

Post by mikeysklar »

Glad that worked out. Happy hacking.

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”