Closed pygoubet closed 3 years ago
What version of PHP are you running? Please make sure you are running 7.4.
as root
apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" >> /etc/apt/sources.list.d/php.list
apt-get update
apt install php7.4-cli php7.4-curl php7.4-mbstring php7.4-xml
as normal user
git clone https://github.com/Raistlfiren/garmin-csv-plan.git
cd garmin-csv-plan
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
./composer.phar install
./bin/console garmin:workout tests/Resource/all-example.csv -n -x
Same error:
In AbstractStep.php line 153:
Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, flo
at given, called in /home/pi/garmin-csv-plan/src/Service/GarminHelper.php on line 73
I will test with a Fedora in a VM instead of Raspbian on Raspberry Pi 3.
The ID I am getting from Garmin is an int. Can you try it now? I changed int to float. Maybe you get a different type of ID than what I am getting? The Id I am getting from Garmin is 324544696...
I am going to see if I can't spin up Raspbian in Virtualbox to test as well. Weird it isn't working there. It should be okay.
"int to float": same problem on my raspbian. I have tried on cloud instance (scaleway) of Fedora 32 x86_64 and it works fine! But same error message with an ARM instance running Ubuntu Bionic and PHP7.4. It has to be related to either ARM architecture or Debian based OS.
@pygoubet - I got VirtualBox installed with Raspbian in a VM. I also ran into the same issue. I don't know why it is being detected as a float but I just pushed a commit that should resolve the issue. https://github.com/Raistlfiren/garmin-csv-plan/commit/5d1712db10ac43fb795d2e6edb532803ad2ee257
I tested the code in my Raspbian VM and it worked just fine. Please try it out and see how it works for you. Thanks!
Thanks @Raistlfiren the commit 5d1712d fixed the problem I have encountered
Hi @Raistlfiren,
The last version of garmin-csv-plan does not run on my raspbian. Could you help me? Thanks advance,
install and run steps:
Result:
Validating and accessing - tests/Resource/all-example.csv
[OK] File valid
Parsing Workouts
Creating workouts
[error] Error thrown while running command "garmin:workout 'tests/Resource/all-example.csv' -n". Message: "Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, float given, called in /home/pi/garmin-csv-plan/src/Service/GarminHelper.php on line 73"
[critical] Uncaught Error: Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, float given, called in /home/pi/garmin-csv-plan/src/Service/GarminHelper.php on line 73
In AbstractStep.php line 153:
Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, float given, called in /home/pi/garmin-csv-plan/src/S
ervice/GarminHelper.php on line 73
garmin:workout [-m|--email EMAIL] [-p|--password PASSWORD] [-x|--delete] [-X|--delete-only] [--dry-run] [-r|--prefix [PREFIX]] [-s|--start START] [-d|--end END] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []