Hello,

I am using a Kasli V2.0.1 with an IP address of 192.168.1.75 (confirmed by pinging as follows)


bladerunner@BladeRunner:~/Desktop/artiqenv1$ ping 192.168.1.75
PING 192.168.1.75 (192.168.1.75) 56(84) bytes of data.
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=2 ttl=64 time=0.057 ms
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=3 ttl=64 time=0.057 ms
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=4 ttl=64 time=0.057 ms
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=5 ttl=64 time=0.059 ms
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=6 ttl=64 time=0.058 ms
64 bytes from 192.168.1.75 [192.168.1.75]: icmp_seq=7 ttl=64 time=0.057 ms
C
--- 192.168.1.75 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6152ms

rtt min/avg/max/mdev = 0.055/0.057/0.059/0.001 ms

The communication over the micro USB works fine for restarting the Kasli:


bladerunner@BladeRunner:~/Desktop/artiqenv1$ artiq_flash start
Open On-Chip Debugger 0.11.0+dev-snapshot (2022-09-15-18:23)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html [openocd.org]
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 25000 kHz
Info : JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
TEMP 74.33 C
VCCINT 0.976 V
VCCAUX 1.777 V
VCCBRAM 0.984 V
VPVN 0.000 V
VREFP 0.000 V
VREFN 0.000 V
VCCPINT 0.000 V
VCCPAUX 0.000 V

VCCODDR 0.000 V

But when I attempt to run the led.py script (modified for my device_db.py and to confirm the build process ran smoothly)


led.py

from artiq.experiment import *

class LED(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("led1")
print('built')

@kernel
def run(self):
    self.core.reset()
    self.led1.on()

flake.nix (for context on my artiq environment

{
inputs.artiq.url = "git+https://github.com/m-labs/artiq.git?ref=release-7";
inputs.extrapkg.url = "git+https://git.m-labs.hk/M-Labs/artiq-extrapkg.git?ref=release-7";
inputs.extrapkg.inputs.artiq.follows = "artiq";
outputs = { self, artiq, extrapkg }:
let
pkgs = artiq.inputs.nixpkgs.legacyPackages.x86_64-linux;
aqmain = artiq.packages.x86_64-linux;
aqextra = extrapkg.packages.x86_64-linux;
in {
defaultPackage.x86_64-linux = pkgs.buildEnv {
name = "artiq-env";
paths = [

========================================

EDIT BELOW

========================================

(pkgs.python3.withPackages(ps: [

List desired Python packages here.

aqmain.artiq
#ps.paramiko # needed if and only if flashing boards remotely (artiq_flash -H)
#aqextra.flake8-artiq

The NixOS package collection contains many other packages that you may find

interesting. Here are some examples:

ps.pandas
ps.numpy
ps.scipy
#ps.numba
ps.matplotlib
aqextra.dax

or if you need Qt (will recompile):

#(ps.matplotlib.override { enableQt = true; })
#ps.bokeh
#ps.cirq
#ps.qiskit
]))
#aqextra.korad_ka3005p
#aqextra.novatech409b

List desired non-Python packages here

aqmain.openocd-bscanspi # needed if and only if flashing boards

Other potentially interesting packages from the NixOS package collection:

pkgs.gtkwave
#pkgs.spyder
#pkgs.R
#pkgs.julia

========================================

EDIT ABOVE

========================================

];
};
};

}

nix.conf (note that I get 'warning: ignoring untrusted substituter 'https://nixbld.m-labs.hk [nixbld.m-labs.hk]'

' when I run nix shell)

substituters = https://nixbld.m-labs.hk https://cache.nixos.org https://cache.nixos.org/
trusted-public-keys = nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

experimental-features = nix-command flakes

I then get this when attempting to run the led.py


bladerunner@BladeRunner:~/Desktop/artiqenv1$ artiq_run led.py
built
Traceback (most recent call last):
File "/nix/store/2w4h6z0k128aa52r1law0zysi68arp34-python3.9-artiq-7.8123.3038639/bin/.artiq_run-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_run.py", line 224, in main
return run(with_file=True)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_run.py", line 210, in run
raise exn
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_run.py", line 203, in run
exp_inst.run()
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/language/core.py", line 54, in run_on_core
return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/core.py", line 140, in run
self._run_compiled(kernel_library, embedding_map, symbolizer, demangler)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/core.py", line 126, in run_compiled
self.comm.check_system_info()
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_kernel.py", line 351, in check_system_info
self.
write_empty(Request.SystemInfo)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_kernel.py", line 319, in write_empty
self.
write_header(ty)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_kernel.py", line 311, in _write_header
self.open()
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_kernel.py", line 197, in open
self.socket = create_connection(self.host, self.port)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/sipyco/keepalive.py", line 103, in create_connection
sock = socket.create_connection((host, port), *args, **kwargs)
File "/nix/store/65h1mb8604dbw077762j702q6b8i0mpw-python3-3.9.13/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/nix/store/65h1mb8604dbw077762j702q6b8i0mpw-python3-3.9.13/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)

ConnectionRefusedError: [Errno 111] Connection refused

This is the device for UW using the device_db.py file that came with it.

So nearest I can tell, the Kasli and the artiq environment are not effectively communicating, but they are interacting. I wonder if this is a version mismatch issue as the kasli and corresponding components were purchased before artiq version 7 went live. In which case, is there a line I can use in the flake.nix file to run this with artiq v.6 instead and test that theory? Otherwise, am I barking up the wrong tree?

Any help would be appreciated
-Brant

I haven't the foggiest idea why the formatting did that when I uploaded. Many apologies.

You might be pinging some other device. What IP address did you set on the computer? Do the ping replies stop when you unplug the Ethernet cable on the computer?
If you are indeed pinging the Kasli then check its serial log.

Thanks for getting back!

I'm pinging the address that came on the device_db.py file from the usb that came with the kasli. I get 100% loss when I have the kasli disconnected from the ethernet cord or from the power supply, so I'm fairly confident that I'm using the correct ip address. I can provide the ifconfig response tomorrow when I get back to work and attempt to check the serial log (it's not a thing I've done before but I understand I should be able to read it out from the micro-usb port using Putty).

So I attempted to change the log level to debug using:

~/Desktop/artiqenv1$ artiq_coremgmt log set_level DEBUG

However, I recieved the same two errors when plugged in:

Traceback (most recent call last):
File "/nix/store/2w4h6z0k128aa52r1law0zysi68arp34-python3.9-artiq-7.8123.3038639/bin/.artiq_coremgmt-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_coremgmt.py", line 114, in main
mgmt.set_log_level(args.level)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_mgmt.py", line 148, in set_log_level
self._write_header(Request.SetLogFilter)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_mgmt.py", line 79, in _write_header
self.open()
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_mgmt.py", line 56, in open
self.socket = create_connection(self.host, self.port)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/sipyco/keepalive.py", line 103, in create_connection
sock = socket.create_connection((host, port), *args, **kwargs)
File "/nix/store/65h1mb8604dbw077762j702q6b8i0mpw-python3-3.9.13/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/nix/store/65h1mb8604dbw077762j702q6b8i0mpw-python3-3.9.13/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

and when not plugged in:

Traceback (most recent call last):
File "/nix/store/2w4h6z0k128aa52r1law0zysi68arp34-python3.9-artiq-7.8123.3038639/bin/.artiq_coremgmt-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_coremgmt.py", line 114, in main
mgmt.set_log_level(args.level)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_mgmt.py", line 148, in set_log_level
self._write_header(Request.SetLogFilter)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_mgmt.py", line 79, in _write_header
self.open()
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/artiq/coredevice/comm_mgmt.py", line 56, in open
self.socket = create_connection(self.host, self.port)
File "/nix/store/wdqwg91z2yicjjn3fpp2jbc1rds469zh-python3-3.9.13-env/lib/python3.9/site-packages/sipyco/keepalive.py", line 103, in create_connection
sock = socket.create_connection((host, port), *args, **kwargs)
File "/nix/store/65h1mb8604dbw077762j702q6b8i0mpw-python3-3.9.13/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/nix/store/65h1mb8604dbw077762j702q6b8i0mpw-python3-3.9.13/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

I'm currently looking for some sort of firewall that could be the culprit, I'm not super familiar with the ubuntu system but it seems that socketing errors like this are commonly caused by firewall problems?

Update:

Disabling ufw doesn't change the error, nor does disconnecting from all other networks.

Just as verification, ifconfig shows my ethernet connection as the same address that I can ping when the cord is in versus out (after inet under enp1s0 in case someone else like me is following along in the future).

~/Desktop/artiqenv1$ ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.75 netmask 255.255.255.0 broadcast 192.168.1.255
ether c0:25:a5:a9:04:46 txqueuelen 1000 (Ethernet)
RX packets 16 bytes 960 (960.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3943 bytes 201241 (201.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 83535 bytes 16543688 (16.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 83535 bytes 16543688 (16.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Please format your posts.

192.168.1.75 is your computer's IP address, it must be different from the one of Kasli.

Ok, I guess I misunderstood that line as being the device address and not my computer address for the interaction. Thanks rjo!

I do still get:

WARNING:artiq.coredevice.comm_kernel:Mismatch between gateware (7.8050.65f8c95.beta) and software (7.8123.3038639) versions

when running the example code, but it works so I imagine that's not a problem at this stage.