ArtusAPI 1.3.4__tar.gz → 1.3.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/artus_api.py +75 -15
  2. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI.egg-info/PKG-INFO +1 -1
  3. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/PKG-INFO +1 -1
  4. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/setup.py +1 -1
  5. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/__init__.py +0 -0
  6. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/commands/__init__.py +0 -0
  7. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/commands/commands.py +0 -0
  8. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/communication/UART/__init__.py +0 -0
  9. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/communication/UART/uart.py +0 -0
  10. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/communication/WiFi/__init__.py +0 -0
  11. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/communication/WiFi/wifi_server.py +0 -0
  12. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/communication/__init__.py +0 -0
  13. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/communication/communication.py +0 -0
  14. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/firmware_update/__init__.py +0 -0
  15. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/firmware_update/firmware_updater.py +0 -0
  16. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/firmware_update/run_full_firmware_update.py +0 -0
  17. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/__init__.py +0 -0
  18. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/__init__.py +0 -0
  19. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/artus_lite.py +0 -0
  20. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/artus_lite_left.py +0 -0
  21. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/artus_lite_plus.py +0 -0
  22. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/artus_lite_plus_left.py +0 -0
  23. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/artus_lite_plus_right.py +0 -0
  24. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/artus_lite/artus_lite_right.py +0 -0
  25. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/robot/robot.py +0 -0
  26. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/sensors/ForceSensor.py +0 -0
  27. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI/sensors/__init__.py +0 -0
  28. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI.egg-info/SOURCES.txt +0 -0
  29. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI.egg-info/dependency_links.txt +0 -0
  30. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI.egg-info/entry_points.txt +0 -0
  31. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI.egg-info/requires.txt +0 -0
  32. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/ArtusAPI.egg-info/top_level.txt +0 -0
  33. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/README.md +0 -0
  34. {ArtusAPI-1.3.4 → ArtusAPI-1.3.6}/setup.cfg +0 -0
@@ -584,10 +584,19 @@ def main_flash():
584
584
  "actuator_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/actuator_64.txt",
585
585
  "peripheral_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_64.txt",
586
586
  "peripheral_plus_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_plus_64.txt",
587
+
587
588
  "master_64_right": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_64.txt",
588
589
  "master_plus_64_right": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_plus_64.txt",
589
- "master_64_left": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_64_left.txt",
590
- "master_plus_64_left": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_plus_64_left.txt"
590
+
591
+ "master_64_left": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_left_64.txt",
592
+ "master_plus_64_left": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_plus_left_64.txt",
593
+
594
+
595
+ "master_partitions_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_partitions_64.txt",
596
+ "master_plus_partitions_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_plus_partitions_64.txt",
597
+
598
+ "master_bootapp0_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_bootapp0_64.txt",
599
+ "master_bootloader_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_bootloader_64.txt"
591
600
  }
592
601
 
593
602
  parser = argparse.ArgumentParser(
@@ -596,8 +605,8 @@ def main_flash():
596
605
 
597
606
  # add required arguments
598
607
  parser.add_argument('-p','--port',required=True,help="required com port (COMx) or (/dev/ttyUSBx)")
599
- parser.add_argument('-r','--robot',required=True,default='artus_lite',help="Robot type",choices=['lite','lite_plus'])
600
- parser.add_argument('-s','--side',required=True,default='right',choices=['left','right'],help='specify hand side, left or right')
608
+ parser.add_argument('-r','--robot',default='artus_lite',help="Robot type",choices=['lite','lite_plus'])
609
+ parser.add_argument('-s','--side',default='right',choices=['left','right'],help='specify hand side, left or right')
601
610
  # parser.add_argument('-b','--baudrate',default=921600,help='specify baudrate',choices=[921600,115200])
602
611
  args = parser.parse_args()
603
612
 
@@ -623,30 +632,67 @@ def main_flash():
623
632
  file_location = bin_paths['peripheral_plus_64']
624
633
  driver_to_flash = 9
625
634
  print('Flashing peripheral')
635
+
626
636
  elif type_flash == 'master':
637
+
627
638
  if args.robot == 'lite':
628
639
  if args.side == 'right':
629
640
  file_location = bin_paths['master_64_right']
630
- print('Flashing master lite right')
631
641
  elif args.side == 'left':
632
642
  file_location = bin_paths['master_64_left']
633
- print('Flashing master lite left')
643
+ partitions_path = bin_paths['master_partitions_64']
644
+
634
645
  elif args.robot == 'lite_plus':
635
646
  if args.side == 'right':
636
647
  file_location = bin_paths['master_plus_64_right']
637
- print('Flashing master lite plus right')
638
648
  elif args.side == 'left':
639
649
  file_location = bin_paths['master_plus_64_left']
640
- print('Flashing master lite plus left')
650
+ partitions_path = bin_paths['master_plus_partitions_64']
651
+ bootapp_path = bin_paths['master_bootapp0_64']
652
+
653
+ bootloader_path = bin_paths['master_bootloader_64']
641
654
  print('Flashing master')
642
655
  # write files
643
656
  # Download and decode base64 firmware file
657
+ print(f"Downloading firmware from firmware file")
644
658
  response = requests.get(file_location)
659
+ if response.status_code != 200:
660
+ print(f"Error: Failed to download firmware from {file_location}. Status code: {response.status_code}")
645
661
  decoded_firmware = base64.b64decode(response.text)
646
662
 
647
663
  # Write decoded firmware to flash.bin
648
664
  with open('flash.bin', 'wb') as f:
649
- f.write(decoded_firmware)
665
+ f.write(decoded_firmware)
666
+
667
+ # For master firmware, also download and decode bootloader files
668
+ if type_flash == 'master':
669
+ print(f"Downloading bootapp from bootapp file")
670
+ # Download and decode bootapp
671
+ response = requests.get(bootapp_path)
672
+ if response.status_code != 200:
673
+ print(f"Error: Failed to download bootloader from {bootapp_path}. Status code: {response.status_code}")
674
+ decoded_bootapp = base64.b64decode(response.text)
675
+ with open('bootapp0.bin', 'wb') as f:
676
+ f.write(decoded_bootapp)
677
+
678
+ # Download and decode partitions
679
+ print(f"Downloading partitions from partitions file")
680
+ response = requests.get(partitions_path)
681
+ if response.status_code != 200:
682
+ print(f"Error: Failed to download partitions from {partitions_path}. Status code: {response.status_code}")
683
+ decoded_partitions = base64.b64decode(response.text)
684
+ with open('partitions.bin', 'wb') as f:
685
+ f.write(decoded_partitions)
686
+
687
+ # Download and decode bootloader
688
+ print(f"Downloading bootloader from bootloader file")
689
+ response = requests.get(bootloader_path)
690
+ if response.status_code != 200:
691
+ print(f"Error: Failed to download bootloader from {bootloader_path}. Status code: {response.status_code}")
692
+ decoded_bootloader = base64.b64decode(response.text)
693
+ with open('bootloader.bin', 'wb') as f:
694
+ f.write(decoded_bootloader)
695
+
650
696
 
651
697
  # flash through api
652
698
  if type_flash != 'master':
@@ -676,12 +722,20 @@ def main_flash():
676
722
  '--flash_mode', 'keep',
677
723
  '--flash_freq', 'keep',
678
724
  '--flash_size', 'keep',
679
- '0x0', 'flash.bin'
725
+ '0x0', 'bootloader.bin',
726
+ '0x8000', 'partitions.bin',
727
+ '0xe000', 'bootapp0.bin',
728
+ '0x10000', 'flash.bin'
680
729
  ]
681
730
 
682
731
  # Run esptool flash command
683
732
  esptool.main(cmd_args)
684
733
 
734
+ # Clean up temporary bootloader files
735
+ os.remove('bootloader.bin')
736
+ os.remove('partitions.bin')
737
+ os.remove('bootapp0.bin')
738
+
685
739
  # delete bin file
686
740
  time.sleep(1)
687
741
  os.remove('flash.bin')
@@ -690,11 +744,17 @@ def main_flash():
690
744
  print('Done')
691
745
 
692
746
  except Exception as e:
693
- print(f"An error occurred: {str(e)}")
694
- try:
695
- os.remove('flash.bin')
696
- except:
697
- pass
747
+ import traceback
748
+ print("An error occurred:")
749
+ traceback.print_exc()
750
+ # Clean up any remaining temporary files
751
+ temp_files = ['flash.bin', 'bootloader.bin', 'partitions.bin', 'bootapp0.bin']
752
+ for file in temp_files:
753
+ if os.path.exists(file):
754
+ try:
755
+ os.remove(file)
756
+ except:
757
+ pass
698
758
 
699
759
  if __name__ == "__main__":
700
760
  test_artus_api()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ArtusAPI
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: API to control Artus Family of Robots by Sarcomere Dynamics Inc
5
5
  Home-page: https://sarcomeredynamics.com/home
6
6
  Author: Sarcomere Dynamics Inc.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ArtusAPI
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: API to control Artus Family of Robots by Sarcomere Dynamics Inc
5
5
  Home-page: https://sarcomeredynamics.com/home
6
6
  Author: Sarcomere Dynamics Inc.
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='ArtusAPI',
5
- version='1.3.4',
5
+ version='1.3.6',
6
6
  description='API to control Artus Family of Robots by Sarcomere Dynamics Inc',
7
7
  project_description='Python API to control Artus Family of Robots by Sarcomere Dynamics Inc',
8
8
  # package_dir={'': '/'}, # tells setuptools that your packages are under src
File without changes
File without changes
File without changes