logicog / firmata_mod

3 stars 1 forks source link

Unsure if make worked correctly #1

Open Linrox opened 1 year ago

Linrox commented 1 year ago

I am using kubuntu 22.10 and arduino mega 2560 R3 to be detected by the OS as a joystick/buttonbox. I can only find the ttyAMC0 connection and the serial folders has the usb-Arduino__www.arduino.cc__0042_754363435303517181D0-if00 and a PCI pci-0000:01:00.0-usb-0:9:1.0

From my research it appears that MEGA2560 only has serial connection and no USBHID, so i was trying to get the firmata_mod work so i can connect and test. However when i tried to make firmata_mod, it return this:

make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0
  You are using:           gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0
  CC [M]  /home/linrox/Desktop/firmata_mod-main/firmata_mod.o
  CC [M]  /home/linrox/Desktop/firmata_mod-main/spi-firmata.o
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c: In function ‘firmata_spi_probe’:
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c:282:39: warning: unused variable ‘pdata’ [-Wunused-variable]
  282 |         struct firmata_platform_data *pdata = dev_get_platdata(&pdev->dev);
      |                                       ^~~~~
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c: In function ‘firmata_spi_remove’:
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c:356:29: warning: unused variable ‘rs’ [-Wunused-variable]
  356 |         struct firmata_spi *rs = spi_controller_get_devdata(ctrl);
      |                             ^~
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c: In function ‘firmata_spi_suspend’:
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c:367:29: warning: unused variable ‘rs’ [-Wunused-variable]
  367 |         struct firmata_spi *rs = spi_controller_get_devdata(ctrl);
      |                             ^~
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c: At top level:
/home/linrox/Desktop/firmata_mod-main/spi-firmata.c:150:13: warning: ‘send_spi_end’ defined but not used [-Wunused-function]
  150 | static void send_spi_end(struct firmata_spi *spi, int channel)
      |             ^~~~~~~~~~~~
  CC [M]  /home/linrox/Desktop/firmata_mod-main/gpio-firmata.o
  CC [M]  /home/linrox/Desktop/firmata_mod-main/i2c-firmata.o
  MODPOST /home/linrox/Desktop/firmata_mod-main/Module.symvers
  CC [M]  /home/linrox/Desktop/firmata_mod-main/firmata_mod.mod.o
  LD [M]  /home/linrox/Desktop/firmata_mod-main/firmata_mod.ko
  BTF [M] /home/linrox/Desktop/firmata_mod-main/firmata_mod.ko
Skipping BTF generation for /home/linrox/Desktop/firmata_mod-main/firmata_mod.ko due to unavailability of vmlinux
  CC [M]  /home/linrox/Desktop/firmata_mod-main/gpio-firmata.mod.o
  LD [M]  /home/linrox/Desktop/firmata_mod-main/gpio-firmata.ko
  BTF [M] /home/linrox/Desktop/firmata_mod-main/gpio-firmata.ko
Skipping BTF generation for /home/linrox/Desktop/firmata_mod-main/gpio-firmata.ko due to unavailability of vmlinux
  CC [M]  /home/linrox/Desktop/firmata_mod-main/i2c-firmata.mod.o
  LD [M]  /home/linrox/Desktop/firmata_mod-main/i2c-firmata.ko
  BTF [M] /home/linrox/Desktop/firmata_mod-main/i2c-firmata.ko
Skipping BTF generation for /home/linrox/Desktop/firmata_mod-main/i2c-firmata.ko due to unavailability of vmlinux
  CC [M]  /home/linrox/Desktop/firmata_mod-main/spi-firmata.mod.o
  LD [M]  /home/linrox/Desktop/firmata_mod-main/spi-firmata.ko
  BTF [M] /home/linrox/Desktop/firmata_mod-main/spi-firmata.ko
Skipping BTF generation for /home/linrox/Desktop/firmata_mod-main/spi-firmata.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'

Not sure if this built correctly.

When i ran the sudo make modules_install it returned ``cp *.ko /lib/modules/uname -r`/kernel depmod



but when i tried ```sudo modprobe firmata_mod [firmata_port=TTYAMC0]``` it return nothing.

Also lsmod | grep firmata only returns firmata_mod
logicog commented 1 year ago

The compilation looks OK. I am not sure about the compiler warning. Does this go away if you do:

sudo apt-get build-dep linux-image-`uname -r`

to install the compiler used also for the kernel build?

The command to insert the module does not use the square braces, this is just to indicate the argument is optional, in your case you would do:

sudo modprobe firmata_mod firmata_port=ttyAMC0

The port starts with lower-case "tty", I think. If unsure, could you look into what "sudo dmesg | tail" prints out the moment you plug the arduino? And then, if this still fails, could you send the output of dmesg once the modprobe fails?

Linrox commented 1 year ago

I tried the sudo apt-get build-dep linux-image-`uname -r it returned

linrox@Lucidmare2:~$ sudo apt-get build-dep linux-image-`uname -r`
[sudo] password for linrox: 
Reading package lists... Done
Picking 'linux-signed' as source package instead of 'linux-image-5.19.0-46-generic'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:linux-signed : Depends: linux-image-unsigned-5.19.0-46-generic (= 5.19.0-46.47) but it is not going to be installed
                          Depends: linux-generate (= 5.19.0-46.47) but it is not installable
E: Unable to correct problems, you have held broken packages.

The second command returned nothing.

logicog commented 1 year ago

Regarding the packages, can you manually also install linux-image-unsigned-5.19.0-46-generic and linux-generate , to fix the dependency problem?

sudo modprobe firmata_mod firmata_port=ttyAMC0 should not return anything, it will wait for about 3 seconds for the firmata firmware to start up after resetting the Arduino. Then, the module should be inserted, and you should be able to see it with lsmod | grep firmata