Shell - Servo Bricklet 2.0

This is the description of the Shell API bindings for the Servo Bricklet 2.0. General information and technical specifications for the Servo Bricklet 2.0 are summarized in its hardware description.

An installation guide for the Shell API bindings is part of their general description.

Examples

The example code below is Public Domain (CC0 1.0).

Callback

Download (example-callback.sh)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Connects to localhost:4223 by default, use --host and --port to change this

uid=XYZ # Change XYZ to the UID of your Servo Bricklet 2.0

# Use position reached callback to swing back and forth
tinkerforge dispatch servo-v2-bricklet $uid position-reached\
 --execute "if   [ {position} -eq  9000 ];
            then echo 'Position: 90°, going to -90°' && tinkerforge call servo-v2-bricklet $uid set-position 0 -9000;
            elif [ {position} -eq -9000 ];
            then echo 'Position: -90°, going to 90°' && tinkerforge call servo-v2-bricklet $uid set-position 0 9000;
            else echo error; fi" &

# Enable position reached callback
tinkerforge call servo-v2-bricklet $uid set-position-reached-callback-configuration 0 true

# Set velocity to 100°/s. This has to be smaller or equal to the
# maximum velocity of the servo you are using, otherwise the position
# reached callback will be called too early
tinkerforge call servo-v2-bricklet $uid set-motion-configuration 0 10000 500000 500000
tinkerforge call servo-v2-bricklet $uid set-position 0 9000
tinkerforge call servo-v2-bricklet $uid set-enable 0 true

echo "Press key to exit"; read dummy

tinkerforge call servo-v2-bricklet $uid set-enable 0 false

kill -- -$$ # Stop callback dispatch in background

Configuration

Download (example-configuration.sh)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# Connects to localhost:4223 by default, use --host and --port to change this

uid=XYZ # Change XYZ to the UID of your Servo Bricklet 2.0

# Servo 1: Connected to port 0, period of 19.5ms, pulse width of 1 to 2ms
#          and operating angle -100 to 100°
tinkerforge call servo-v2-bricklet $uid set-degree 0 -10000 10000
tinkerforge call servo-v2-bricklet $uid set-pulse-width 0 1000 2000
tinkerforge call servo-v2-bricklet $uid set-period 0 19500
tinkerforge call servo-v2-bricklet $uid set-motion-configuration 0 500000 1000 1000 # Full velocity with slow ac-/deceleration


# Servo 2: Connected to port 5, period of 20ms, pulse width of 0.95 to 1.95ms
#          and operating angle -90 to 90°
tinkerforge call servo-v2-bricklet $uid set-degree 5 -9000 9000
tinkerforge call servo-v2-bricklet $uid set-pulse-width 5 950 1950
tinkerforge call servo-v2-bricklet $uid set-period 5 20000
tinkerforge call servo-v2-bricklet $uid set-motion-configuration 5 500000 500000 500000 # Full velocity with full ac-/deceleration

tinkerforge call servo-v2-bricklet $uid set-position 0 10000 # Set to most right position
tinkerforge call servo-v2-bricklet $uid set-enable 0 true

tinkerforge call servo-v2-bricklet $uid set-position 5 -9000 # Set to most left position
tinkerforge call servo-v2-bricklet $uid set-enable 5 true

echo "Press key to exit"; read dummy

tinkerforge call servo-v2-bricklet $uid set-enable 0 false
tinkerforge call servo-v2-bricklet $uid set-enable 5 false

API

Possible exit codes for all tinkerforge commands are:

  • 1: interrupted (ctrl+c)
  • 2: syntax error
  • 21: Python 2.5 or newer is required
  • 22: Python argparse module is missing
  • 23: socket error
  • 24: other exception
  • 25: invalid placeholder in format string
  • 26: authentication error
  • 201: timeout occurred
  • 209: invalid argument value
  • 210: function is not supported
  • 211: unknown error

Every function of the Servo Brick API that has a servo_channel parameter can address a servo with the servo channel (0 to 9). If it is a setter function then multiple servos can be addressed at once with a bitmask for the servos, if the highest bit is set. For example: 1 will address servo 1, (1 << 1) | (1 << 5) | (1 << 15) will address servos 1 and 5. This allows to set configurations to several servos with one function call. It is guaranteed that the changes will take effect in the same PWM period for all servos you specified in the bitmask.

Command Structure

The common options of the call and dispatch commands are documented here. The specific command structure is shown below.

tinkerforge call servo-v2-bricklet [<option>..] <uid> <function> [<argument>..]
Parameters:
  • <uid> – Type: String
  • <function> – Type: String

The call command is used to call a function of the Servo Bricklet 2.0. It can take several options:

  • --help shows help for the specific call command and exits
  • --list-functions shows a list of known functions of the Servo Bricklet 2.0 and exits
tinkerforge dispatch servo-v2-bricklet [<option>..] <uid> <callback>
Parameters:
  • <uid> – Type: String
  • <callback> – Type: String

The dispatch command is used to dispatch a callback of the Servo Bricklet 2.0. It can take several options:

  • --help shows help for the specific dispatch command and exits
  • --list-callbacks shows a list of known callbacks of the Servo Bricklet 2.0 and exits
tinkerforge call servo-v2-bricklet <uid> <function> [<option>..] [<argument>..]
Parameters:
  • <uid> – Type: String
  • <function> – Type: String

The <function> to be called can take different options depending of its kind. All functions can take the following options:

  • --help shows help for the specific function and exits

Getter functions can take the following options:

  • --execute <command> shell command line to execute for each incoming response (see section about output formatting for details)

Setter functions can take the following options:

  • --expect-response requests response and waits for it

The --expect-response option for setter functions allows to detect timeouts and other error conditions calls of setters as well. The device will then send a response for this purpose. If this option is not given for a setter function then no response is sent and errors are silently ignored, because they cannot be detected.

tinkerforge dispatch servo-v2-bricklet <uid> <callback> [<option>..]
Parameters:
  • <uid> – Type: String
  • <callback> – Type: String

The <callback> to be dispatched can take several options:

  • --help shows help for the specific callback and exits
  • --execute <command> shell command line to execute for each incoming response (see section about output formatting for details)

Basic Functions

tinkerforge call servo-v2-bricklet <uid> get-status
Output:
  • enabled – Type: Bool Array, Length: 10
  • current-position – Type: Int Array, Length: 10, Unit: 1/100 °, Range: ?
  • current-velocity – Type: Int Array, Length: 10, Unit: 1/100 °/s, Range: [0 to 500000]
  • current – Type: Int Array, Length: 10, Unit: 1 mA, Range: [0 to 216 - 1]
  • input-voltage – Type: Int, Unit: 1 mV, Range: [0 to 216 - 1]

Returns the status information of the Servo Bricklet 2.0.

The status includes

  • for each channel if it is enabled or disabled,
  • for each channel the current position,
  • for each channel the current velocity,
  • for each channel the current usage and
  • the input voltage.

Please note that the position and the velocity is a snapshot of the current position and velocity of the servo in motion.

tinkerforge call servo-v2-bricklet <uid> set-enable <servo-channel> <enable>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <enable> – Type: Bool, Default: false
Output:
  • no output

Enables a servo channel (0 to 9). If a servo is enabled, the configured position, velocity, acceleration, etc. are applied immediately.

tinkerforge call servo-v2-bricklet <uid> get-enabled <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • enable – Type: Bool, Default: false

Returns true if the specified servo channel is enabled, false otherwise.

tinkerforge call servo-v2-bricklet <uid> set-position <servo-channel> <position>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <position> – Type: Int, Unit: 1/100 °, Range: ?
Output:
  • no output

Sets the position in °/100 for the specified servo channel.

The default range of the position is -9000 to 9000, but it can be specified according to your servo with set-degree.

If you want to control a linear servo or RC brushless motor controller or similar with the Servo Brick, you can also define lengths or speeds with set-degree.

tinkerforge call servo-v2-bricklet <uid> get-position <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • position – Type: Int, Unit: 1/100 °, Range: ?

Returns the position of the specified servo channel as set by set-position.

tinkerforge call servo-v2-bricklet <uid> get-current-position <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • position – Type: Int, Unit: 1/100 °, Range: ?

Returns the current position of the specified servo channel. This may not be the value of set-position if the servo is currently approaching a position goal.

tinkerforge call servo-v2-bricklet <uid> get-current-velocity <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • velocity – Type: Int, Unit: 1/100 °/s, Range: [0 to 500000]

Returns the current velocity of the specified servo channel. This may not be the velocity specified by set-motion-configuration. if the servo is currently approaching a velocity goal.

tinkerforge call servo-v2-bricklet <uid> set-motion-configuration <servo-channel> <velocity> <acceleration> <deceleration>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <velocity> – Type: Int, Unit: 1/100 °/s, Range: [0 to 500000], Default: 100000
  • <acceleration> – Type: Int, Unit: 1/100 °/s², Range: [0 to 500000], Default: 50000
  • <deceleration> – Type: Int, Unit: 1/100 °/s², Range: [0 to 500000], Default: 50000
Output:
  • no output

Sets the maximum velocity of the specified servo channel in °/100s as well as the acceleration and deceleration in °/100s²

With a velocity of 0 °/100s the position will be set immediately (no velocity).

With an acc-/deceleration of 0 °/100s² the velocity will be set immediately (no acc-/deceleration).

tinkerforge call servo-v2-bricklet <uid> get-motion-configuration <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • velocity – Type: Int, Unit: 1/100 °/s, Range: [0 to 500000], Default: 100000
  • acceleration – Type: Int, Unit: 1/100 °/s², Range: [0 to 500000], Default: 50000
  • deceleration – Type: Int, Unit: 1/100 °/s², Range: [0 to 500000], Default: 50000

Returns the motion configuration as set by set-motion-configuration.

tinkerforge call servo-v2-bricklet <uid> set-pulse-width <servo-channel> <min> <max>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <min> – Type: Int, Unit: 1 µs, Range: [0 to 232 - 1], Default: 1000
  • <max> – Type: Int, Unit: 1 µs, Range: [0 to 232 - 1], Default: 2000
Output:
  • no output

Sets the minimum and maximum pulse width of the specified servo channel in µs.

Usually, servos are controlled with a PWM, whereby the length of the pulse controls the position of the servo. Every servo has different minimum and maximum pulse widths, these can be specified with this function.

If you have a datasheet for your servo that specifies the minimum and maximum pulse width, you should set the values accordingly. If your servo comes without any datasheet you have to find the values via trial and error.

Both values have a range from 1 to 65535 (unsigned 16-bit integer). The minimum must be smaller than the maximum.

The default values are 1000µs (1ms) and 2000µs (2ms) for minimum and maximum pulse width.

tinkerforge call servo-v2-bricklet <uid> get-pulse-width <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • min – Type: Int, Unit: 1 µs, Range: [0 to 232 - 1], Default: 1000
  • max – Type: Int, Unit: 1 µs, Range: [0 to 232 - 1], Default: 2000

Returns the minimum and maximum pulse width for the specified servo channel as set by set-pulse-width.

tinkerforge call servo-v2-bricklet <uid> set-degree <servo-channel> <min> <max>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <min> – Type: Int, Unit: 1/100 °, Range: [-215 to 215 - 1], Default: -9000
  • <max> – Type: Int, Unit: 1/100 °, Range: [-215 to 215 - 1], Default: 9000
Output:
  • no output

Sets the minimum and maximum degree for the specified servo channel (by default given as °/100).

This only specifies the abstract values between which the minimum and maximum pulse width is scaled. For example: If you specify a pulse width of 1000µs to 2000µs and a degree range of -90° to 90°, a call of set-position with 0 will result in a pulse width of 1500µs (-90° = 1000µs, 90° = 2000µs, etc.).

Possible usage:

  • The datasheet of your servo specifies a range of 200° with the middle position at 110°. In this case you can set the minimum to -9000 and the maximum to 11000.
  • You measure a range of 220° on your servo and you don't have or need a middle position. In this case you can set the minimum to 0 and the maximum to 22000.
  • You have a linear servo with a drive length of 20cm, In this case you could set the minimum to 0 and the maximum to 20000. Now you can set the Position with set-position with a resolution of cm/100. Also the velocity will have a resolution of cm/100s and the acceleration will have a resolution of cm/100s².
  • You don't care about units and just want the highest possible resolution. In this case you should set the minimum to -32767 and the maximum to 32767.
  • You have a brushless motor with a maximum speed of 10000 rpm and want to control it with a RC brushless motor controller. In this case you can set the minimum to 0 and the maximum to 10000. set-position now controls the rpm.

Both values have a possible range from -32767 to 32767 (signed 16-bit integer). The minimum must be smaller than the maximum.

The default values are -9000 and 9000 for the minimum and maximum degree.

tinkerforge call servo-v2-bricklet <uid> get-degree <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • min – Type: Int, Unit: 1/100 °, Range: [-215 to 215 - 1], Default: -9000
  • max – Type: Int, Unit: 1/100 °, Range: [-215 to 215 - 1], Default: 9000

Returns the minimum and maximum degree for the specified servo channel as set by set-degree.

tinkerforge call servo-v2-bricklet <uid> set-period <servo-channel> <period>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <period> – Type: Int, Unit: 1 µs, Range: [1 to 1000000], Default: 19500
Output:
  • no output

Sets the period of the specified servo channel in µs.

Usually, servos are controlled with a PWM. Different servos expect PWMs with different periods. Most servos run well with a period of about 20ms.

If your servo comes with a datasheet that specifies a period, you should set it accordingly. If you don't have a datasheet and you have no idea what the correct period is, the default value (19.5ms) will most likely work fine.

The minimum possible period is 1µs and the maximum is 1000000µs.

The default value is 19.5ms (19500µs).

tinkerforge call servo-v2-bricklet <uid> get-period <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • period – Type: Int, Unit: 1 µs, Range: [1 to 1000000], Default: 19500

Returns the period for the specified servo channel as set by set-period.

tinkerforge call servo-v2-bricklet <uid> get-servo-current <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • current – Type: Int, Unit: 1 mA, Range: [0 to 216 - 1]

Returns the current consumption of the specified servo channel in mA.

tinkerforge call servo-v2-bricklet <uid> set-servo-current-configuration <servo-channel> <averaging-duration>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <averaging-duration> – Type: Int, Unit: 1 ms, Range: [1 to 255], Default: 255
Output:
  • no output

Sets the averaging duration of the current measurement for the specified servo channel in ms.

tinkerforge call servo-v2-bricklet <uid> get-servo-current-configuration <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • averaging-duration – Type: Int, Unit: 1 ms, Range: [1 to 255], Default: 255

Returns the servo current configuration for the specified servo channel as set by set-servo-current-configuration.

tinkerforge call servo-v2-bricklet <uid> set-input-voltage-configuration <averaging-duration>
Parameters:
  • <averaging-duration> – Type: Int, Unit: 1 ms, Range: [1 to 255], Default: 255
Output:
  • no output

Sets the averaging duration of the input voltage measurement for the specified servo channel in ms.

tinkerforge call servo-v2-bricklet <uid> get-input-voltage-configuration
Output:
  • averaging-duration – Type: Int, Unit: 1 ms, Range: [1 to 255], Default: 255

Returns the input voltage configuration as set by set-input-voltage-configuration.

tinkerforge call servo-v2-bricklet <uid> get-overall-current
Output:
  • current – Type: Int, Unit: 1 mA, Range: [0 to 216 - 1]

Returns the current consumption of all servos together in mA.

tinkerforge call servo-v2-bricklet <uid> get-input-voltage
Output:
  • voltage – Type: Int, Unit: 1 mV, Range: [0 to 216 - 1]

Returns the input voltage in mV. The input voltage is given via the black power input connector on the Servo Brick.

Advanced Functions

tinkerforge call servo-v2-bricklet <uid> set-current-calibration <offset>
Parameters:
  • <offset> – Type: Int Array, Length: 10, Unit: 1 mA, Range: [-215 to 215 - 1]
Output:
  • no output

Sets an offset value (in mA) for each channel.

Note: On delivery the Servo Bricklet 2.0 is already calibrated.

tinkerforge call servo-v2-bricklet <uid> get-current-calibration
Output:
  • offset – Type: Int Array, Length: 10, Unit: 1 mA, Range: [-215 to 215 - 1]

Returns the current calibration as set by set-current-calibration.

tinkerforge call servo-v2-bricklet <uid> get-spitfp-error-count
Output:
  • error-count-ack-checksum – Type: Int, Range: [0 to 232 - 1]
  • error-count-message-checksum – Type: Int, Range: [0 to 232 - 1]
  • error-count-frame – Type: Int, Range: [0 to 232 - 1]
  • error-count-overflow – Type: Int, Range: [0 to 232 - 1]

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

  • ACK checksum errors,
  • message checksum errors,
  • framing errors and
  • overflow errors.

The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.

tinkerforge call servo-v2-bricklet <uid> set-status-led-config <config>
Parameters:
  • <config> – Type: Int, Range: See symbols, Default: 3
Output:
  • no output

Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets.

You can also turn the LED permanently on/off or show a heartbeat.

If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.

The following symbols are available for this function:

For <config>:

  • status-led-config-off = 0
  • status-led-config-on = 1
  • status-led-config-show-heartbeat = 2
  • status-led-config-show-status = 3
tinkerforge call servo-v2-bricklet <uid> get-status-led-config
Output:
  • config – Type: Int, Range: See symbols, Default: 3

Returns the configuration as set by set-status-led-config

The following symbols are available for this function:

For config:

  • status-led-config-off = 0
  • status-led-config-on = 1
  • status-led-config-show-heartbeat = 2
  • status-led-config-show-status = 3
tinkerforge call servo-v2-bricklet <uid> get-chip-temperature
Output:
  • temperature – Type: Int, Unit: 1 °C, Range: [-215 to 215 - 1]

Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.

tinkerforge call servo-v2-bricklet <uid> reset
Output:
  • no output

Calling this function will reset the Bricklet. All configurations will be lost.

After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!

tinkerforge call servo-v2-bricklet <uid> get-identity
Output:
  • uid – Type: String, Length: up to 8
  • connected-uid – Type: String, Length: up to 8
  • position – Type: Char, Range: [a to h, z]
  • hardware-version – Type: Int Array, Length: 3
    • 0: major – Type: Int, Range: [0 to 255]
    • 1: minor – Type: Int, Range: [0 to 255]
    • 2: revision – Type: Int, Range: [0 to 255]
  • firmware-version – Type: Int Array, Length: 3
    • 0: major – Type: Int, Range: [0 to 255]
    • 1: minor – Type: Int, Range: [0 to 255]
    • 2: revision – Type: Int, Range: [0 to 255]
  • device-identifier – Type: Int, Range: [0 to 216 - 1]

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here

Callback Configuration Functions

tinkerforge call servo-v2-bricklet <uid> set-position-reached-callback-configuration <servo-channel> <enabled>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9, 215 to 33791]
  • <enabled> – Type: Bool, Default: false
Output:
  • no output

Enable/Disable position-reached callback.

tinkerforge call servo-v2-bricklet <uid> get-position-reached-callback-configuration <servo-channel>
Parameters:
  • <servo-channel> – Type: Int, Range: [0 to 9]
Output:
  • enabled – Type: Bool, Default: false

Returns the callback configuration as set by set-position-reached-callback-configuration.

Callbacks

Callbacks can be used to receive time critical or recurring data from the device:

tinkerforge dispatch servo-v2-bricklet <uid> example

The available callbacks are described below.

Note

Using callbacks for recurring events is always preferred compared to using getters. It will use less USB bandwidth and the latency will be a lot better, since there is no round trip time.

tinkerforge dispatch servo-v2-bricklet <uid> position-reached
Output:
  • servo-channel – Type: Int, Range: [0 to 9]
  • position – Type: Int, Unit: 1/100 °, Range: ?

This callback is triggered when a position set by set-position is reached. If the new position matches the current position then the callback is not triggered, because the servo didn't move. The parameters are the servo and the position that is reached.

You can enable this callback with set-position-reached-callback-configuration.

Note

Since we can't get any feedback from the servo, this only works if the velocity (see set-motion-configuration) is set smaller or equal to the maximum velocity of the servo. Otherwise the servo will lag behind the control value and the callback will be triggered too early.

Internal Functions

Internal functions are used for maintenance tasks such as flashing a new firmware of changing the UID of a Bricklet. These task should be performed using Brick Viewer instead of using the internal functions directly.

tinkerforge call servo-v2-bricklet <uid> set-bootloader-mode <mode>
Parameters:
  • <mode> – Type: Int, Range: See symbols
Output:
  • status – Type: Int, Range: See symbols

Sets the bootloader mode and returns the status after the requested mode change was instigated.

You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier and CRC are present and correct.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

The following symbols are available for this function:

For <mode>:

  • bootloader-mode-bootloader = 0
  • bootloader-mode-firmware = 1
  • bootloader-mode-bootloader-wait-for-reboot = 2
  • bootloader-mode-firmware-wait-for-reboot = 3
  • bootloader-mode-firmware-wait-for-erase-and-reboot = 4

For status:

  • bootloader-status-ok = 0
  • bootloader-status-invalid-mode = 1
  • bootloader-status-no-change = 2
  • bootloader-status-entry-function-not-present = 3
  • bootloader-status-device-identifier-incorrect = 4
  • bootloader-status-crc-mismatch = 5
tinkerforge call servo-v2-bricklet <uid> get-bootloader-mode
Output:
  • mode – Type: Int, Range: See symbols

Returns the current bootloader mode, see set-bootloader-mode.

The following symbols are available for this function:

For mode:

  • bootloader-mode-bootloader = 0
  • bootloader-mode-firmware = 1
  • bootloader-mode-bootloader-wait-for-reboot = 2
  • bootloader-mode-firmware-wait-for-reboot = 3
  • bootloader-mode-firmware-wait-for-erase-and-reboot = 4
tinkerforge call servo-v2-bricklet <uid> set-write-firmware-pointer <pointer>
Parameters:
  • <pointer> – Type: Int, Unit: 1 B, Range: [0 to 232 - 1]
Output:
  • no output

Sets the firmware pointer for write-firmware. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256).

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

tinkerforge call servo-v2-bricklet <uid> write-firmware <data>
Parameters:
  • <data> – Type: Int Array, Length: 64, Range: [0 to 255]
Output:
  • status – Type: Int, Range: [0 to 255]

Writes 64 Bytes of firmware at the position as written by set-write-firmware-pointer before. The firmware is written to flash every 4 chunks.

You can only write firmware in bootloader mode.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

tinkerforge call servo-v2-bricklet <uid> write-uid <uid>
Parameters:
  • <uid> – Type: Int, Range: [0 to 232 - 1]
Output:
  • no output

Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first.

We recommend that you use Brick Viewer to change the UID.

tinkerforge call servo-v2-bricklet <uid> read-uid
Output:
  • uid – Type: Int, Range: [0 to 232 - 1]

Returns the current UID as an integer. Encode as Base58 to get the usual string version.