Mikrotik RB750 r2 series POE

Hello. Which one Mikrotik board you are using?
Please show the result for the following commands:

mtpoe_ctrl --action=get_fw_ver --verbose
mtpoe_ctrl --action=get_voltage --verbose
mtpoe_ctrl --action=get_temperature --verbose
BusyBox v1.29.3 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r8068-0cda4af005
 -----------------------------------------------------
root@poebox_soba:~# mtpoe_ctrl --action=get_fw_ver --verbose
spi mode: 0
bits per word: 8
max speed: 8000 Hz (8 KHz)

tx: 41 00 00 9A 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
tx: 41 00 00 9A 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
tx: 41 00 00 9A 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
{
  error: -101,
  err_descr: "Tx CRC error: 0x0 vs 0x9a"
}
root@poebox_soba:~# mtpoe_ctrl --action=get_voltage --verbose
spi mode: 0
bits per word: 8
max speed: 8000 Hz (8 KHz)

tx: 42 00 00 7E 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
tx: 42 00 00 7E 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
tx: 42 00 00 7E 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
{
  error: -101,
  err_descr: "Tx CRC error: 0x0 vs 0x7e"
}
root@poebox_soba:~# mtpoe_ctrl --action=get_temperature --verbose
spi mode: 0
bits per word: 8
max speed: 8000 Hz (8 KHz)

tx: 43 00 00 D5 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
tx: 43 00 00 D5 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
tx: 43 00 00 D5 00 00 00 00 00 00
rx: 00 00 00 00 00 00 00 00 00 00
{
  error: -101,
  err_descr: "Tx CRC error: 0x0 vs 0xd5"
}
root@poebox_soba:~# cat /proc/cpuinfo
system type             : Qualcomm Atheros QCA9533 ver 2 rev 0
machine                 : MikroTik RouterBOARD 750P r2
processor               : 0
cpu model               : MIPS 24Kc V7.4
BogoMIPS                : 432.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

root@poebox_soba:~# cat /proc/cmdline
no-uart no-buzzer no-nand parts=1 boot_part_size=16777216 gpio=0 HZ=325000000 mem=64M kmac=6C:3B:6B:DB:D1:12 board=750-hb board=750-hb ver=6.42rc39 hw_opt=00084009 boot=1 mlc=11 console=ttyS0,115200 rootfstype=squashfs noinitrd
root@poebox_soba:~#

Im not at home curently, this is output of commands above.

The answer in the form of zeros indicates that the commands do not reach ATtiny via SPI bus.
Did you use my source tree(https://github.com/adron-s/openwrt) or change something yourself?

Plese show the result of the following command(In RouterOS):
/interface ethernet poe settings print

In my case:

[admin@MikroTik] > /interface ethernet poe settings print 
                   version: 2.17
  ether1-poe-in-long-cable: no
root@hut00:~# cat /proc/cmdline 
no-uart no-buzzer no-nand parts=1 boot_part_size=16777216 gpio=0 HZ=325000000 mem=64M kmac=D4:CA:6D:C6:4A:EF board=750-hb Board=750-hb ver=6.43.1 bver=3.29 hw_opt=00084009 boot=1 mlc=11 rootfstype=squashfs noinitrd

Used your source tree. Had installed older openwrt(lede) before, without support for ATtiny poe. As mentioned here [RFC][Help] Finishing MikroTik OmniTIK UPA-5HnD support
after that when reinstalled official ROS poe was no longer detected/working(all poe options, info gone). Is it possibly connected to older openwrt version setting gpio 14 (now labled as ATtiny reset gpio for powerbox) up? Or ATtiny firmare got damaged somehow. Is there a way to flash ATtiny firmware from openwrt?

Yes, you absolutely rightly wrote. The old version of OpenWRT seems to be setting a low level on the gpio 14(Reset), switching the ATtiny to a flashing mode with subsequent damage it firmware. At the moment there is no way to flash the ATtiny from OpenWRT but I'll think about how it can be implemented.

Hm, I though something on those lines.
GPIO14 was set that way as Mikrotik labeled that GPIO as POE in their GPL patch.
Shouldnt avrdude be able to flash over SPI?
Firmware for the Attiny can be easily extracted from Mikrotiks firmware.

How does Ros do this update, can we force it to do it?

I was looking into it and they have a daemon that checks the current version of POE firmware on boot and if there is newer packaged in that ROS version it calls some binary that does the flashing

Yes. I know this. The file is called /etc/poeio.atflash
Avrdude apparently knows how to flash a ATtiny 461 but I have not tried it.

Than maybe if the ROS busybox hack still works we can run that binary manualy... Need to investigate this a litle when i get home...

I tried to get RouterOS root shell but It did not work.

In RouterOS there is a special kernel module for flashing(poeupdate) and already through it a userspace program(poeupdatefw) is flashing the firmware.

So then forcing a update could work with a rooted ROS

Yes, of course.

Ideally, for mtpoe_ctrl we need to implement a firmware update mode. I'll look at how hard it is and try to implement it as much as possible.

I think that I got one Powerbox that has POE that does not work anymore after OpenWrt.
I will see if avrdude works, if it works then its really easy

Yes, but provided that the /etc/poeio.atflash file is being flashed "as is" (its contents are not packed/crypted).

With an old version of ROS this will probably work. http://blog.rchapman.org/posts/Getting_shell_on_a_RouterBoard/
Problem is that current openwrt does not support yaffs2, and old openwrt CC does not support PowerBox.
We need to bring back support for yaffs2 to current openwrt to get root and that is way out of my level.

yaffs2 and new OpenWRT is to HARD! Now I'm working on modifying the mtpoe_ctrl for the flashing mode.

I managed to get busybox shell on ROS on powerbox, using another hack. Will try running "poeupdatefw" and get back with my findings.