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. mobilephase

    mobilephase New Member

    Joined:
    Feb 27, 2019
    Messages:
    4
    Likes Received:
    1
    Yea, so far every test print has resulted in the printer resetting before the print starts, also in octoprint I set XYZ to inverted due to the home button made the head travel in the wrong direction
     
  2. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    ok, atleast the bug is consistent...

    I was worried that I might have damaged my printer whilst reverse engineering the pcb with my probes.
     
  3. mobilephase

    mobilephase New Member

    Joined:
    Feb 27, 2019
    Messages:
    4
    Likes Received:
    1
    In the configuration.h file you have the baudrate set to 38400, in octoprint using 19200, my setup is using your uploaded hex file so I did not compile myself, would thing cause the error?
     
  4. mobilephase

    mobilephase New Member

    Joined:
    Feb 27, 2019
    Messages:
    4
    Likes Received:
    1
    Here is the error from my serial log, it looks like the printer is getting a start command a second time and then resetting.

    2019-02-27 22:07:45,772 - Send: N37 G1 X77.578 Y56.58 E0.57688*102
    2019-02-27 22:07:45,778 - Recv: ok T:201.22 /200.00 @:0
    2019-02-27 22:07:45,787 - Send: N38 G1 X78.151 Y57.123 E0.59173*88
    2019-02-27 22:07:49,422 - Communication timeout while printing, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
    2019-02-27 22:07:49,446 - Send: N39 M105*29
    2019-02-27 22:07:50,076 - Recv: starstart
    2019-02-27 22:07:50,093 - Recv: echo: Watchdog Reset
    2019-02-27 22:07:50,160 - Recv:
     
  5. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    What I think happens is that the AtMega 1684 resets and that this causes the communication time out. My suspicion is that the reset is caused by a safety trigger in the Marlin Firmware somehow.
     
  6. Dragonsquirrel

    Dragonsquirrel New Member

    Joined:
    Aug 24, 2018
    Messages:
    3
    Likes Received:
    4
    I wonder if the resets are related to why Buccaneer came up with their slightly crazy 4 byte checksum, because apparently without it, they couldn't maintain reliable serial comms with the atmega board during printing. Rather than fix the issues with the board design to prevent the data corruption, they added a more robust checksum, and software handshaking on top of the normal gcode usage.

    Anyways, looks like you are seeing Octoprint say that Marlin sent that it just performed a watchdog reset. That's a feature in marlin designed to check if the atmega has gone loopy, and stopped processing code.. In theory you could stop it performing a watchdog reset by undefining USE_WATCHDOG but in practice remember that doing this could lead to the atmega crashing while doing something important, like temperature regulation, which could lead to flames and other excitement.

    Definitely keeping an eye on your progress tho =) My own attempts to run octoprint on it with stock atmega firmware are paused at the mo as I have to work on other stuff. I had octoprint able to send the right checksums, but the printer would get ahead of itself, hinting that perhaps their firmware expects the client to wait in some circumstances before transmitting the next command, where as octoprint wanted to keep sending until the printer yelled uncle. I didn't dig too much deeper but it would have meant adding a per gcode wait for required response approach to keep the flow of data steady as per the original buccaneer app.
     
    racer likes this.
  7. Pratik

    Pratik New Member

    Joined:
    Nov 18, 2019
    Messages:
    1
    Likes Received:
    0
    Hi guys, thanks for the instructions. When I try this, OctoPrint gets stuck on "connecting" but never connects.
    Here is the terminal:
    Recv: �Z���Z*
    Recv: �\x1b���Z*\x0b�j���Z+Recv: �����Z*\x0b�j���Z*\x0b�+���Z*\x0b�j���Z*\x0b�;���Z*\x0b�z���Z*Recv: �\x1b���Z*No answer from the printer within the connection timeout, trying another helloSend: N0 M110 N0*125There was a timeout while trying to connect to the printerChanging monitoring state from "Connecting" to "Offline"Connection closed, closing down monitor

    Any idea how to fix it?

    UPDATE: I think I found the problem: I never uploaded the marlin firmware. However, I don't see how I can get avrdude to install the file, as it is on my laptop and not the printer? Help would be appreciated. Thanks.
     
    #87 Pratik, Nov 21, 2019
    Last edited: Nov 21, 2019
  8. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    You need to install avrdude on the Cubieboard of the buccaneer, transfer the firmware to the Cubieboard and than flash the ATMEL chip from the Cubieboard

    Instructions are posted in this thread on page 4
     
  9. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    **** BREAKING NEWS ****

    I've got an updated version of the firmware based on Marlin 2.0. It seems to work fine, no more funny resets. I think I made a mistake in the end-stop definition of the previous firmware .hex file resulting in the Buccaneer resetting unexpectedly.

    As the system prevents uploading hex files, I've added a .txt extension. After downloading the file, just remove the .txt extension (leaving .hex at the end of the filename) and upload the firmware to the buccaneer.
     

    Attached Files:

    #89 racer, Dec 29, 2019
    Last edited: Dec 29, 2019
    m2t and mark tomlinson like this.
  10. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    For those that would like to make the changes to Marlin 2.0 you can use my files.

    Steps that you need to take to add the BUCCANEER Logic Board 1.0 Rev C PRD to Marlin 2.0 (= original board in the BUCCANNEER):

    1) add pins_BUCCANEER.h to the following folder..\Marlin-2.0.x\Marlin\src\pins\sanguino\
    2) add the following line to boards.h , the file can be found in ..\Marlin-2.0.x\Marlin\src\core\

    after the line in boards.h :
    #define BOARD_ANET_10 1509 // Anet 1.0 (Melzi clone)
    add the following line:
    #define BOARD_BUCCANEER 1510 // BUCCANEER

    3) Replace the Configuration.h file with the one below
    4) Replace the Configuration_adv.h with the one below

    After that, compile Marlin and upload the hexfile to the Buccaneer, than flash the hex file with AVR dude.
     

    Attached Files:

    Syther56, m2t, fajarhto and 1 other person like this.
  11. m2t

    m2t New Member

    Joined:
    Apr 28, 2020
    Messages:
    8
    Likes Received:
    1
    Hi everyone, hi Racer!


    First I would like to thank you (congrats!) for giving me hope. I received a Buccaneer for my 30th birthday, got it sent at home for my 32nd, and could never print a single piece with it, because of many bugs at that time. Now I'm 36, and I'm hopping to be able to do something with it, thanks to you! You made an amazing work recomputing all the FW and Armbian config.

    So I read carefully all your posts, try to follow all steps, took notes and here I am, with some improvement but still not printing...

    So here are some feedback from a newbie, more used to part design than to firmware flashing...

    First the concept: just summarizing all what you did.
    What I have is a Buccaneer Pirate 3D printer, a Linux based computer (a raspberryPi in my case) with an SD card reader and a wifi network with internet access.

    The buccaneer itself is composed for what concerns electronics of:

    • an Atmega1284P microcontroller, to control all the printing process,
    • an ATTINY microchip, to control the lights (ok, that's nice…)
    • a Cubieboard2 microprocessor, that will be the interface with the printer and allow to manage the job process, send the jobs, ... using a SD card as drive.

    What we want to achieve (following your post #65):

    1. Create a micro SD with Armbian, and configure Armbian on the Cubieboard2 of the Buccaneer (Wifi + uart5 and uart6) (post #70)
    2. Installe & configure Octoprint on the Cubieboard2, as well as CuraEngine for printing interface (post #71)
    3. create a Marlin firmware with Arduino IDE and saved the .hex file on a pc, then transfer it to the Cubieboard2 (posts #68, #69, #89, #90)
    4. Installe & configure avrdude, and flashed the new firmware to the onboard ATmega1284 (post #68)
    and I would add: send a file to the printer and see it work ! (you didn’t poste anything!)


    So first step for me, with notes:

    1) Installing Armbian (post #70)

    I flashed Armbian on the SD card using native `dd` tool in debian:

    `sudo sh -c "p7zip -c -d Armbian_20.02.1_Cubieboard2_buster_current_5.4.20.7z | dd of=/dev/sda"`

    Then I needed to extend the partition to the whole size of the SC card using fdisk, with the only trick that first byte must be keept at its original value (8192 for me):

    '''
    sudo fdisk /dev/sda
    > d # delete
    > wq # write quit
    > fdisk /dev/sda
    > n # new
    > p # primary
    > 1 #number
    > start byte : 8192
    > end byte by default
    >wq # write quit
    # resize partition
    sudo e2fsck -f /dev/sda1
    sudo resize2fs /dev/sda1

    '''

    Armbian 20.02.1 version, that I used, comes with an option to configure wifi access before installing it, using the file `boot/armbian_first_run.txt`. I mounted the device to configure that file but I didn't manage to have it work properly. Same, all requested changes (like enabling UART5 and UART6) could be done while SD card is still in PC and mounted

    However, I installed ARmbian on SD card, installed SD card in the CB2, started it with ethernet and configured the wifi access. But I could never configure hotspot access. Tried my best, with the Armbian-config then manually, could not. I’ll try again. Why is that needed actually?

    Well that’s it for today's feedback, I’ll continue the updates later on.
     
    #91 m2t, May 6, 2020
    Last edited: May 9, 2020
    mark tomlinson likes this.
  12. racer

    racer Member

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

    just saw your post. Indeed I didn't post a make with the Buccaneer, because I made a mistake in the firmware causing the printer to reset. I fixed that a later moment, but just can't remember what it was exactly. I think it had something to do with the endstop configuration and axis direction.

    After fixed it, I started printing, but the filament got stuck (bummer). The buccaneer is still waiting until I have some time again to look at it.

    Resizing the partition of the SD can also easily be done with gparted on your debian machine.

    If you want I can make an image of the SD that I created and send it to you via wetransfer.

    Regards,
    R4C3R
     
    m2t likes this.
  13. m2t

    m2t New Member

    Joined:
    Apr 28, 2020
    Messages:
    8
    Likes Received:
    1
    Hy Racer,
    Thank you for your prompt answer, and the SD image proposal, but I think it's ok for me. For tht hotspot configuration, I just mixed up NetworkManager and hostAPD, and lost a lot of time with isc-dhcp-server and dhcpd, but it's ok, and after all it's not that necessary.

    So I continued to follow your posts and it was very helpfull.

    Installing Octpoprint and Cura Engine (post #71):

    Only one thing missing in your post that I found in the video: when running `sudo visudo`, it's to add at the bottom of the file:
    `octoprint ALL=(ALL) NOPASSWD:ALL`
    I faced little issues, because python 2.7 is now depreciated and raises lots of warnings. Also, MarkupSafe was refereed as obsolete version and I had to install it manually.
    Installing CuraEngine as exactly as you described.
    Then installing avrdude (post #68) worked fine, as well as pushing the firmware.

    So here I am, almost done, but...
    • Octoprint cannot connect to the board. I tried "auto" connection, then manually, then changed the baudrate to 38400 as in your Configuration.h file, but still get the same error:
      `Changing monitoring state from "Offline" to "Error: Connection error, see Terminal tab"
      Unexpected error while connecting to serial port: /dev/ttyS5 SerialException: 'Could not configure port: (5, 'Input/output error')' @ comm.py:_openSerial:2691 (hook default)
      `
    • Then I thought it may be worth recompiling the FW, so what I did (after searching for looooong time) is:
      • download the last Marlin FW (2.0.5.3),
      • download the Atmega1284(P) board config for arduinoIDE,
      • adapt your files to new version of Configuration.h and Configuration_adv.h (new versions here under),
      • copy the boards.h and pins_BUCCANEER.h files as you explained,
      • add the following lines in Marlin/src/pins/pins.h:324-325
        `
        #elif MB(BUCCANEER)
        #include "sanguino/pins_BUCCANEER.h" // ATmega1284P env:sanguino1284P
        `
      • use the following config:
        upload_2020-5-9_0-15-22.png
    • Then I have a brand new updated FW, but still cannot connect to the printer with Octopus...
    So, if you have any idea to help me on that issue, I'll be very thankful!
    Otherwise, I'll continue duckduckgoing (sounds worse than g**gling...), but that's it for tonight.
    Thanks to all for any help or support.
    M.
     

    Attached Files:

  14. m2t

    m2t New Member

    Joined:
    Apr 28, 2020
    Messages:
    8
    Likes Received:
    1
    Well, actually I've one more question about the principle...
    How does Octoprint "recognize" the printer FW, knowing how to communicate with it? Is there kind of norm for that?
    We did not configure anything in Octoprint neither CuraEngine.
    Sorry if it's a silly question.
     
  15. racer

    racer Member

    Joined:
    Dec 23, 2017
    Messages:
    33
    Likes Received:
    14
    The standard is the gcode standard. In the Marlin firmware you have defined your printer, and Marlin accepts gcode.

    I wouldn't recommend slicing on the buccanneer / cubieboard.

    Use Cura on your PC to slice, but make sure that you define the proper g-code in Cura --> machine settings --> g-code flavour -->Marlin
     
  16. m2t

    m2t New Member

    Joined:
    Apr 28, 2020
    Messages:
    8
    Likes Received:
    1
    Ok, thanks ! Sorry, I hadn't notice that G-code allows bidirectional communication, by sending request (I've re-read the docs...). I'm on it !
    Any clue about my communication error from octoprint to Atmega?
    (`Changing monitoring state from "Offline" to "Error: Connection error, see Terminal tab"
    Unexpected error while connecting to serial port: /dev/ttyS5 SerialException: 'Could not configure port: (5, 'Input/output error')' @ comm.py:_openSerial:2691 (hook default)
    `)
    You mentionned
    Could that be the cause?
    Thanks again...
     
  17. racer

    racer Member

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

    Could it be an access rights issue?

    Maybe the octoprint user has to be added to the dial-out group?

    Did you do take the steps below?

    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
     
    #97 racer, May 10, 2020
    Last edited: May 10, 2020
  18. racer

    racer Member

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

    No don't think so. The error is on the side of your PC.

    do you see /dev/ttyS5 if you do an ls /dev/ttyS* from the command prompt?

    What do you get with:

    stty -F /dev/ttyS5 -g
     
  19. m2t

    m2t New Member

    Joined:
    Apr 28, 2020
    Messages:
    8
    Likes Received:
    1
    The ls result seems ok:
    `crw-rw---- 1 root dialout 4, 69 May 9 00:37 /dev/ttyS5`
    and octoprint is indeed member on dialout group.
    Though I get that error with stty: `stty: /dev/ttyS5: Input/output error` (also with octoprint user)
    Well seen !
    I'll look in that direction, thanks.
     
  20. m2t

    m2t New Member

    Joined:
    Apr 28, 2020
    Messages:
    8
    Likes Received:
    1
    Well, now I'm far beyond my level of understanding...

    I've tried and got the following:
    > setserial -ga /dev/ttyS5
    /dev/ttyS5, Line 5, UART: unknown, Port: 0x0000, IRQ: 0
    Baud_base: 0, close_delay: 50, divisor: 0
    closing_wait: 3000
    Flags: spd_normal
    > sudo setserial /dev/ttyS5 uart 16550A baud_base 115200
    Cannot set serial info: Device or resource busy

    It seems another program is usingI think the best to do at that point is to restart the whole process, with strictly the necessary steps, and hope it will get better...

    --- EDIT
    I restarting the process from start, still get the same issue.
    (Also get the same hotspot issue by the way... is it linked)
    Searching the web did not help me... I'll try again (later) without hotspot setting just in case.
     
    #100 m2t, May 10, 2020
    Last edited: May 10, 2020

Share This Page