1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Repurposing Pirate3d Buccaneer

Discussion in 'Off Topic' started by milw, Jul 29, 2017.

  1. Eeon Macaulay

    Eeon Macaulay New Member

    Joined:
    Dec 14, 2018
    Messages:
    1
    Likes Received:
    0
    Hi Mark I am new to thye Buccanneer Pirate 3D and dowloaded the Windows 0.9.11 version and loaded it on a laptop. It fired up ok but I cannot connect to the printer. I used the WiFi pw shown on the back of the printer. It tries to connect but no go. My Laptop connects to the Internet ok. I bought the unit in a working condition and it powers up ok . Is there any further steps I might have missed can to help with this. Eeon
     
  2. Jesstr8803

    Jesstr8803 New Member

    Joined:
    Sep 24, 2018
    Messages:
    4
    Likes Received:
    2

    Attached Files:

    #62 Jesstr8803, Jan 3, 2019
    Last edited by a moderator: Jan 3, 2019
    Geof and mark tomlinson like this.
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    (and that was gnarly typing that in)
     
    Geof likes this.
  4. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Hi,

    The last couple of days I have been analyzing the Buccaneer Logic Board 1.0 Rev C PRD.

    My goal is to flash Marlin FW onto the ATMEGA1284P which is located on the board and use the cubieboard with Octoprint.

    The Buccaneer Logic Board 1.0 Rev C PRD has a piggy backed Cubieboard2 with two edimax wifi dongles, a RJ45 network interface abd a micro SD Card reader. I think there is also an eMMC module installed. Many connectors are missing (probably to keep it all low cost).

    The Logic Board itself contains:

    1) an ATTINY 1634R-SU just for managing the LED's, as far as I can conclude.
    2) an ATMEGA1284P which contains the 3D print firmware
    3) 4x A4988 stepper motor drivers

    There are 4 Stepper motors, 3 end stops, 1 case fan, 1, hotend, 1 hotend fan, 1 thermistor, 1 optical z-probe that all must be configured in the Marlin Firmware.

    I think I have managed to find all the connections / pins that are required to operate a "brainwashed" Buccaneer. I would like to share my findings with you. You will find my notes in the attached PDF's.

    Goodluck and please keep me updated if you make any progress in brainwashing the Buccaneer.


    Regards,
     

    Attached Files:

  5. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    OK guys, I did it! I brainwashed my Buccaneer :) using the original hardware! Now it runs on Octoprint with Marlin FW :)

    I still need to tweak the Marlin FW.

    What I did was the following:

    1) create a micro SD with Armbian
    2) configured Armbian on the Cubieboard2 of the Buccaneer (Wifi + uart5 and uart6).
    3) installed & configured Octoprint on the Cubieboard2
    4) created a Marlin firmware with Arduino IDE and saved the .hex file on my pc and transferred it to the Cubieboard2
    5) installed & configured avrdude
    6) flashed the new firmware to the onboard ATmega1284

    Now I can control the Buccaneer via Octoprint. However, I got some settings mixed up in the Marlin FW and need to reconfigure & experiment with settings.

    Maybe I have some time during the week to continue the work.:)
     
  6. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Hi Dragonsquirrel,

    The full set of buccaneer-gcode is located in a file in the root directory of the buccaneer. The file is called buccaneer-gcode.txt I've attached it for your reference.

    However, now that I have brainwashed the Buccaneer, it might be easier to switch to standard Marlin FW.

    Regards,
    Racer
     

    Attached Files:

  7. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    The ATTINY on the board is responsible for the lighting of the Buccaneer, pirated 3D used a small app for managing the light, /usr/bin/lightControl. This is what I found out.


    ATTINY coms for lighting

    communication between Cubieboard2 and ATTINY finds place via /dev/ttyS2

    These are the serial settings, read with stty -F /dev/ttyS2 -a

    stty -F /dev/ttyS2 -a
    speed 115200 baud; rows 0; columns 0; line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^H; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
    rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
    -parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
    -ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
    -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
    -isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

    With the stty -F /dev/ttyS2 -g the options can be read in an stty format, this can then be used to open the port with the proper settings.

    open port like this
    stty -F /dev/ttyS2 4:0:18b2:a30:3:1c:7f:8:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

    The communication between Cubieboard2 and ATTINY seems limited to single byte commands, e.g. echo -n “0” > /dev/ttyS2 makes the front light blink slowly in white. This is also a sort of “watch-dog” light after a while it turns red, so the “0” command should be send in regular intervals. Below are the commands that I found:

    Command Action
    0 Slowly white blinking front light, no case light (same with 1,2,4,5)
    3 Slowly red blinking front light, no case light (same with 7)
    6 Slowly orange blinking front light, case light on (same with 9)
    E Previous selected colour does quick double blink and case light is on
     
    #67 racer, Jan 15, 2019
    Last edited: Jan 15, 2019
  8. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    I have created a Buccaneer printer in the Marlin FW. If you copy the files below the folder of the Marlin FW you can select the Buccaneer as the target 3D printer. The Configuration.h is still work in progress. The axis movement seems fine, the end-stops work, the autolevelling bed-probing seems fine, the fan and hot-end work and the extruder work. I am not sure if I have selected the right thermistor and PID probably needs tweaking.

    I also need to work on the G-code (start, end, filament change etc.)

    As the ATMEGA on Buccaneer logicboard is not connected via USB, the firmware needs to be uploaded via the ICSP. You could connect an ICSP programmer to the onboard connector for the ATMEGA or alternatively install and use avrdude (which I did).


    How to install avrdude on Armbian

    sudo add-apt-repository ppa:ubuntuhandbook1/apps
    sudo apt-get update
    sudo apt-get install avrdude avrdude-doc
    sudo nano /etc/avrdude.conf

    search for the following section

    #programmer
    # id = "linuxgpio";
    # desc = "Use the Linux sysfs interface to bitbang GPIO lines";
    # type = "linuxgpio";
    # reset = ?;
    # sck = ?;
    # mosi = ?;
    # miso = ?;
    #;

    and add the following two interfaces (kindly note that the pin numbers might depend on the OS that you are using, I installed Armbian on the Cubieboard2)


    programmer
    id = "linuxgpio-atmega";
    desc = "Use the Linux sysfs interface to bitbang GPIO lines";
    type = "linuxgpio";
    reset = 96;
    sck = 97;
    mosi = 99;
    miso = 98;
    ;


    programmer
    id = "linuxgpio-attiny";
    desc = "Use the Linux sysfs interface to bitbang GPIO lines";
    type = "linuxgpio";
    reset = 100;
    sck = 101;
    mosi = 103;
    miso = 102;
    ;


    Ctrl-x and save

    test the connection with the following commands

    sudo avrdude -c linuxgpio-atmega -p ATmega1284P -v
    sudo avrdude -c linuxgpio-attiny -p ATtiny1634 -v

    In the Arduino IDE you have to compile the Marlin firmware (click on verify, but don't click on the upload button). After that click on the Sketch in the menu bar and click on export compiled library. Two files will be created in the Marlin FW folder:

    Marlin.ino.sanguino.hex
    Marlin.ino.with_bootloader.sanguino.hex

    We don't need a bootloader, because there is no other way of flashing the ATMEGA except for the ICSP interface. So copy Marlin.ino.sanguino.hex to a folder on the Cubieboard2 and use the following command to flash it with avrdude to the ATMEGA:

    sudo avrdude -c linuxgpio-atmega -p ATmega1284P -v -U flash:w:/path-to-the-firmware-file/Marlin.ino.sanguino.hex:i

    e.g. I used the following command:

    sudo avrdude -c linuxgpio-atmega -p ATmega1284P -v -U flash:w:/home/octoprint/atmegaFW/Marlin.ino.sanguino.hex:i
     

    Attached Files:

    #68 racer, Jan 15, 2019
    Last edited: Jan 15, 2019
  9. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Here is a copy of the Marlin FW that I currently use (still work in progress) Buccaneer.ino.sanguino.hex .

    The forum won't let me upload an .hex file so I changed the extention to .txt so after downloading you have to change the extention back from .txt to .hex

    You can then upload it to the ATMEGA on the Buccaneer Logicboard (see post above with avrdude instructions).
     

    Attached Files:

  10. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Here are the instructions on how to install & configure Armbian for the Cubieboard2 for the Buccaneer:



    How to install ARMBIAN on the Cubieboard2 of the Buccaneer


    Download the Armbian image (Stretch version) for Cubieboard2 and flash it to a micro SD. I used Etcher to flash the image to the micro SD. Armbian can be found here: https://www.armbian.com/cubieboard-2/

    Flash the Armbian OS to a micro SD, I used a 16GB Transcend class 10 micro SD.

    Replace the micro SD in the Buccaneer with the newly flashed micro SD. This video tutorial shows how to get to the electronics of the buccaneer.



    Plug a network cable into the Cubieboard and power it up. Find the IP address of the Cubieboard that was assigned and logon with ssh onto the Cubieboard. (root password is: 1234)

    ssh root@ip-address.of.the.Cubieboard (e.g. ssh root@192.168.1.128)

    I am on Ubuntu and like to use ssh keys instead of using the password all the time, so I copied the ssh key to the Cubieboard with the following command

    ssh-copy-id root@192.168.1.128

    In that case I only have to provide the password once, to copy the key. Next time I login, I don’t need to provide the password anymore, because the Cubieboard recognizes my key automatically. If you haven’t created a key, you can create one simply by typing ssh-keygen -t rsa at the prompt.

    Then run the following command to configure the Wifi

    armbian-config

    (configure one Wifi dongle for WLAN and one Wifi dongle as Access Point)

    After configuring the Wifi exit armbian-config.

    You also have to Enable uart 5 and 6 in the Cubieboard Firmware:

    1) open armbianEnv.txt

    nano /boot/armbianEnv.txt

    2) add the following line in order to enable uart5 and uart6 for communication with the ATMEGA and ATTINY on the Logicboard of the Buccaneer

    overlays=uart5 uart6

    ctrl x and y to save

    now reboot

    The next step will be installing Octoprint on the Cubieboard2. (see next post)
     
  11. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    How to install OCTOPRINT on the Cubieboard2

    Please install Armbian on the Cubieboard first (see post above)

    I used this instructional video for the Octoprint installation (thx to guys from Print 'N Play ):



    Carry out the following commands

    As root create a user for Octoprint
    adduser octoprint
    usermod -a -G tty octoprint
    usermod -a -G dialout octoprint
    adduser octoprint sudo
    sudo visudo
    sudo passwd octoprint -d

    Install all required utilities & software
    apt-get update
    sudo apt-get install git python-pip python-dev python-setuptools psmisc virtualenv -y
    sudo su octoprint
    cd ~
    wget https://pypi.python.org/packages/source/p/pyserial/pyserial-2.7.tar.gz
    tar -zxf pyserial-2.7.tar.gz
    cd pyserial-2.7
    sudo python setup.py install

    Install Octoprint
    cd ~
    git clone https://github.com/foosel/OctoPrint.git
    cd OctoPrint
    virtualenv venv
    ./venv/bin/python setup.py install

    Install CuraEngine
    cd ~
    git clone -b legacy https://github.com/Ultimaker/CuraEngine.git
    cd CuraEngine
    make

    Make Octoprint start on boot
    sudo cp ~/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint
    sudo chmod +x /etc/init.d/octoprint
    sudo cp ~/OctoPrint/scripts/octoprint.default /etc/default/octoprint

    sudo nano /etc/default/octoprint

    Change the user to octoprint, and then edit the DAEMON line to remove the hashtag ad the beginning, and set the proper operating directory

    DAEMON=/home/octoprint/OctoPrint/venv/bin/octoprint
    OCTOPRINT_USER=octoprint

    Ctrl + X to save and quit

    sudo update-rc.d octoprint defaults
    sudo service octoprint start

    Start Octoprint
    ~/OctoPrint/venv/bin/octoprint serve

    In Octoprint you can now connect to the ATMEGA via port /dev/ttyS5 with a baudrate of 19200
     
    m2t likes this.
  12. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    I think with all the information & instructions above anyone should be able to give his / her Buccaneer a proper brainwash :).

    Please contact me if you have any questions.

    Regards,
    Racer


    Things to do:
    - validate Thermistor settings
    - create proper G-code for start, end, filament change etc.
    - case fan not integrated in software yet
    - improve lighting software, maybe flash attiny with new software, need to find out how the ATTINY has been wired exactly (ICSP and serial comms are known, LED wiring is still a bit of a black box although pin 3 and 4 seem to be connected to the LED's) --> done, see post below
     

    Attached Files:

    #72 racer, Jan 15, 2019
    Last edited: Jan 15, 2019
    m2t and mark tomlinson like this.
  13. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Buccaneer lighting

    The lighting of the Buccaneer is managed by an ATTINY1634 mounted on the Buccaneer Logicboard. There are two lightsources, 7 WS2812 SMD RGB LED’s in the front and 4 white SMD LED’s for lighting the inside of the case.

    The ATTINY 1634 is wired to the LED’s via the J-lights connector.

    The J-Lights connector on the Buccaneer Logicboard is wired as follows:

    Pin 1 2 3 4
    Colour
    Black Red Blue Brown
    Function GND VCC RGB data White PWM

    If you are going to write new code for the managing the lighting of the Buccaneer you need the following pin information:

    ATTINY pin #1 = Arduino digital 0 = TX to the Cubieboard2
    ATTINY pin #2 = Arduino digital 1 = RX to the Cubieboard2

    ATTINY pin #3 = Arduino digital pin 2 = the RGB lights data pin on the case front
    ATTINY pin #4 = Arduino digital pin 3 = the white lights PWM pin inside the case

    ATTINY pin #14 = Arduino digital pin 17 = ICSP RESET
    ATTINY pin #16 = Arduino digital pin 12 = ICSP SCK
    ATTINY pin #19 = Arduino digital pin 15 = ICSP MISO
    ATTINY pin #20 = Arduino digital pin 16 = ICSP MOSI

    ATTINY pin#14 = also connected to Cubieboard2 GPIO 100
    ATTINY pin#16 = also connected to Cubieboard2 GPIO 101
    ATTINY pin#19 = also connected to Cubieboard2 GPIO 102
    ATTINY pin#20 = also connected to Cubieboard2 GPIO 103

    The FastLED library can be used for managing the 7 RGB LED’s in the front (select WS2812). The case light inside can be managed via a simple PWM signal on Arduino digital pin 3. Communcation between Cubieboard and ATTINY can be done via the serial connection on Arduino digital pins 0 and 1 (TX and RX).

    Uploading new firmware to the ATTINY can be done via avrdude

    sudo avrdude -c linuxgpio-attiny -p ATtiny1634 -v -U flash:w:/path-to-new-firmware/yourFW.hex:i

    (but I haven’t tested this last step yet)
     
    m2t and mark tomlinson like this.
  14. harr

    harr New Member

    Joined:
    Jan 23, 2019
    Messages:
    2
    Likes Received:
    0
    Hey Racer,

    Found this thread after discovering that the Pirate3D biz is now defunct and the software difficult to find. I've been able to follow all of your instructions above and can now control the printer via Octoprint. Great job on your documentation! I'm wondering if you've had any success on the G-code for the start, end, and filament change? I've been experimenting but it could take me a while to work out, not having done any of this manually before. Cheers - Harr
     
  15. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Hi Harr,

    nice to know that there is atleast one other person in this world looking at the Buccaneer 3D printer. I felt a bit lonely after the posts without responses ;)

    In the meantime I have an updated version of the pins_BUCCANEER.h which now includes the pin for the enclosure fan.

    However I havent't had much time since to work on the Buccaneer. I think I have a configuration error in Marlin, because now I get a spontaneous reset when homing X/Y but haven't had the time yet to investigate the root cause of the problem.

    Did you use my Configuration.h or did you make your own? If you made your own, maybe you can post it here so I can have a look and find where I have the mistake in my configuration.

    So no Gcode start / stop etc. yet.

    Regards,
     

    Attached Files:

  16. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Also I have changed the settings for the thermistor in the Configuration.h file, this is what I use now, after the auto calibration:

    ....
    #define TEMP_SENSOR_0 1
    ....
    // Buccaneer
    #define DEFAULT_Kp 10.99
    #define DEFAULT_Ki 0.99
    #define DEFAULT_Kd 30.39

    // Ultimaker
    //#define DEFAULT_Kp 22.2
    //#define DEFAULT_Ki 1.08
    //#define DEFAULT_Kd 114
     
    m2t likes this.
  17. harr

    harr New Member

    Joined:
    Jan 23, 2019
    Messages:
    2
    Likes Received:
    0
    Cool - we didn't really use the fan when printing previously. Ended up making a custom spool mount (vertical) as the built in one wasn't great.

    Actually I was getting this too tonight and ended up resolving the issue by pressing the x axis sensor switch on the extruder a few times manually (when off) and it righted itself. Sounds like there's an issue though if we've both experienced resets on homing.

    I actually used the hex file you uploaded rather than compiling.
     
  18. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    Ok, thx for the feedback!
     
  19. mobilephase

    mobilephase New Member

    Joined:
    Feb 27, 2019
    Messages:
    4
    Likes Received:
    1
    Just brainwashed my Buccaneer. Havnt gotten to a test print yet, but it finally feels like a printer I can use! Thanks for all your work!
     
    racer likes this.
  20. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    @mobilephase Kindly note that the Marlin configuration still might be buggy, I haven't the time yet to look where the spontaneoous reset comes from that I experienced. Anyway if you find the solution, please let us know!
     

Share This Page